By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

help with custom combobox and WndProc

P: n/a

i am developing a custom combobox for my company's needs that is made
up of a textbox, listbox, button. i am using c#. everything is fine
except for one issue.

in a normal combobox, when the dropdown is visible and the user clicks
anywhere else, the dropdown gets hidden. i am trying to replicate
this behavior and have tried using the Leave and LostFocus events. i
have had marginal success when my dropdown is visible and i click on
another button, for example. since the focus goes to the button (i'm
assuming), the desired behavior is had.

however, if my dropdown is visible and i click on part of the form
that has nothing on it, nothing happens. i tried to override WndProc
to listen for the WM_CAPTURECHANGED message, but that message never
seems to get generated. i then put a normal windows combobox on the
same form and listened to its events. i notice that when i click away
from the standadr combobox and the dropdown is showing, a message
numbered 2111 (that's in hex, the decimal is 8465) is sent out.

i then monitored the messages on the listbox ( = dropdown) portion of
my custom combobox and i see this 2111 message appearing as well when
i manually close the dropdown.

so it looks like this message is what i want to be listening for,
however, no messages at all get generated when i click away from my
custom combobox. if no messages are being generated, then i don't see
how overriding WndProc is the answer to my problem.

what can i do here? i've done extensive research online and haven't
found the solution - there must be others who have written their own
comboboxes. how did you get around this problem?

thanks in advance,
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.