主题:COMBOBOX的问题
[code=c]
...
case WM_CREATE:
...
hwComboBox = CreateWindow(TEXT("COMBOBOX"), NULL,
WS_CHILD | WS_TABSTOP | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWN , 500,140, 100, 30, hwnd, NULL, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
SendMessage(hwComboBox, CB_RESETCONTENT, 0, 0);
SendMessage(hwComboBox, CB_ADDSTRING, 0, (LPARAM)TEXT("文本1"));
SendMessage(hwComboBox, CB_ADDSTRING, 0, (LPARAM)TEXT("文本2"));
SendMessage(hwComboBox, CB_ADDSTRING, 0, (LPARAM)TEXT("文本3"));
SendMessage(hwComboBox, CB_SETCURSEL, 0, 0);
...
[/code]
为什么控件中的下拉菜单里面什么也没有?
...
case WM_CREATE:
...
hwComboBox = CreateWindow(TEXT("COMBOBOX"), NULL,
WS_CHILD | WS_TABSTOP | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWN , 500,140, 100, 30, hwnd, NULL, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
SendMessage(hwComboBox, CB_RESETCONTENT, 0, 0);
SendMessage(hwComboBox, CB_ADDSTRING, 0, (LPARAM)TEXT("文本1"));
SendMessage(hwComboBox, CB_ADDSTRING, 0, (LPARAM)TEXT("文本2"));
SendMessage(hwComboBox, CB_ADDSTRING, 0, (LPARAM)TEXT("文本3"));
SendMessage(hwComboBox, CB_SETCURSEL, 0, 0);
...
[/code]
为什么控件中的下拉菜单里面什么也没有?