|
-
August 18th, 2015, 08:00 AM
#1
deselect text in combo box
I have created a combo box like this :
Code:
combo_hwnd = CreateWindowEx(WS_EX_WINDOWEDGE, "COMBOBOX" , NULL, WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWN , left, top, width , height , parent_hwnd, NULL, NULL, NULL);
When I select an item from a drop down list, its text appears normally in the edit part, but it always appears as selected text. I want to deselect this text, and I tried to achieve that by sending CB_SETEDITSEL message, right after item selection:
Code:
case WM_COMMAND:
switch(HIWORD(wParam))
{
case CBN_SELCHANGE:
SendMessage(combo_hwnd , CB_SETEDITSEL , 0, MAKELPARAM(-1,0));
break;
}
This doesn't change anything to my combo box, so does anybody know how to deselect the text from a combo box?
Last edited by user125; August 18th, 2015 at 09:23 AM.
-
August 18th, 2015, 08:51 AM
#2
Re: deselect text in combo box
Try PostMessage rather than SendMessage.
Victor Nijegorodov
-
August 18th, 2015, 03:48 PM
#3
Re: deselect text in combo box
That seems to work. Thanks.
-
August 18th, 2015, 04:09 PM
#4
Re: deselect text in combo box
Welcome!
Victor Nijegorodov
Tags for this Thread
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
|