ComboBox in WIN32 programming.
-
I created a combo box using the fllowing createwindowex() function. m_hWnd = CreateWindowEx( NULL, L"ComboBox", L"Appliance Name", WS_CHILD | WS_VISIBLE | CBS_HASSTRINGS | CBS_DROPDOWNLIST , 10, 0, 200, 30, hwndParent, (HMENU) IDC_MAIN_COMBOBOX, GetModuleHandle(NULL), NULL); And added two strings using the CB_ADDSTRING message. Still when i click the dropdownbox. it is not opening the list box.just a thik line only appears below that Combobox. Can any one detect what wrong I am doing?
birajendu CyberG India Delhi India
-
I created a combo box using the fllowing createwindowex() function. m_hWnd = CreateWindowEx( NULL, L"ComboBox", L"Appliance Name", WS_CHILD | WS_VISIBLE | CBS_HASSTRINGS | CBS_DROPDOWNLIST , 10, 0, 200, 30, hwndParent, (HMENU) IDC_MAIN_COMBOBOX, GetModuleHandle(NULL), NULL); And added two strings using the CB_ADDSTRING message. Still when i click the dropdownbox. it is not opening the list box.just a thik line only appears below that Combobox. Can any one detect what wrong I am doing?
birajendu CyberG India Delhi India
Can you try with CB_SETMINVISIBLE [^]macro? This message sets the minimum number of visible items in the drop-down list of a combo box. Instead of using SendMesssage you can call ComboBox_SetMinVisible [^]macro and pass the number of elements required.
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts
-
Can you try with CB_SETMINVISIBLE [^]macro? This message sets the minimum number of visible items in the drop-down list of a combo box. Instead of using SendMesssage you can call ComboBox_SetMinVisible [^]macro and pass the number of elements required.
-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts
My issue was different. The problem was it required more clint area while drop down. case CBN_DROPDOWN: { RECT rcClient; // Get the coordinates of the parent window's client area. GetClientRect((HWND) lParam, &rcClient); MoveWindow((HWND)lParam,rcClient.left,rcClient.top ,rcClient.right,rcClient.bottom+300,true); } I added this above code. which fixed my issue.
birajendu SonicWALL Bangalore India