Archived

This topic is now archived and is closed to further replies.

tdk_ratboy

ComboBox tutorial

Recommended Posts

resource.h:
quote:

#define IDC_COMBOBOXID 201


resource.rc:
quote:

#include <windows.h>
#include "resource.h"

IDD_DIALOG DIALOG 44,27,262,74
STYLE DS_CENTER|DS_SETFOREGROUND|WS_CAPTION|WS_SYSMENU
CAPTION "WINDOW_TITLE"
FONT 8, "Tahoma"
BEGIN
COMBOBOX IDC_COMBOBOXID,15,21,80,70,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP
END


your cpp:
quote:

...
HWND combo_list = GetDlgItem(hwnd, IDC_COMBOBOXID);

SendMessage(combo_list,CB_ADDSTRING,0,(LPARAM)"One");
SendMessage(combo_list,CB_ADDSTRING,0,(LPARAM)"Two");
SendMessage(combo_list,CB_ADDSTRING,0,(LPARAM)"Three");
...



You play with that ;o)

/shrt

[edited by - shrt on October 21, 2003 5:14:38 PM]

Share this post


Link to post
Share on other sites