-
August 11th, 2011, 05:07 AM
#1
[RESOLVED] Win32 Combobox
Hello,
I'm creating a combobox, im not sure why but the dropdownlist is not shown, I can use the keys to navigate between the items, but not see them. This is the code:
Code:
HWND CreateComboBox(bool bVisisble,const int iX, const int iY, const int iWidth, const int iHeight, HWND hWndParent,HMENU hmID)
{
HWND hComboBox = CreateWindowEx(0,"Combobox", 0, WS_CHILD | (bVisisble ? WS_VISIBLE : NULL) | CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | 0x00002000, iX, iY, iWidth, iHeight, hWndParent, hmID, GetModuleHandle(0),NULL);
ApplyCalibri(hComboBox);
return hComboBox;
}
const char *cScanTypes[] = { "Byte", "2 Bytes", "4 Bytes",
"Float", "Double", "AoB",
};
{
HWND hTest = CreateComboBox(true,10,100,150,25,hWnd,0);
HWND hTest2 = CreateComboBox(true,180,100,150,25,hWnd,0);
for(int Count = 0; Count < 6; Count++)
{
SendMessage(hTest ,CB_ADDSTRING,0,(LPARAM)cScanTypes[Count]);
SendMessage(hTest2,CB_ADDSTRING,0,(LPARAM)cScanOptions[Count]);
int x = GetLastError();
}
}
-
August 11th, 2011, 03:04 PM
#2
Re: Win32 Combobox
A long since I used pure win32...
Works ok for me however if I use your CreateWindowEx with fixed values instead of params. Setting iHeight to 0 give the behaviour you describe so what values do you use?
-
August 11th, 2011, 03:09 PM
#3
Re: Win32 Combobox
Originally Posted by S_M_A
A long since I used pure win32...
Works ok for me however if I use your CreateWindowEx with fixed values instead of params. Setting iHeight to 0 give the behaviour you describe so what values do you use?
I do not understand what values you mean? I guess I posted them in the code snippet?
-
August 11th, 2011, 04:09 PM
#4
Re: Win32 Combobox
Yes you did... guess I'm more tired than I thought I was...
I tried your values and if you change ,,,25 to for instance ,,,250 the dropdown part shows up.
-
August 11th, 2011, 04:50 PM
#5
Re: Win32 Combobox
Originally Posted by S_M_A
Yes you did... guess I'm more tired than I thought I was...
I tried your values and if you change ,,,25 to for instance ,,,250 the dropdown part shows up.
Thanks a lot man
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|