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

preventing combobox dropdown box from showing

P: n/a
Is there anyway to prevent the white box that drops down when you do a
combobox dropdown from showing? I am trying to make a custom combobox which
requires showing a custom form in its place, but the white box shows up
still ontop of the new form that is taking its palce even though there is no
items in the white box. Any windows messages or anything you can trap or
whatnot? thanks!
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
I don't know of a way to prevent the combo box extending, but a
different way to come at the problem might be to not inherit from the
combo box but create a control containing a textbox and your custom
drop down.

I found a design along these lines on CodeProject.com when I was
looking for a dropdown combo that contained a treeview instead of a
list. (search for TreeView Combo)

As a design concept it seemed to work well.

Alan.

Nov 21 '05 #2

P: n/a
If I understand your requirements, you want a control that looks like a
combo box, but when the down arrow is clicked, a separate form is
displayed (modally I suppose).

With some experimenting you could inherit from a combo box and find a
way to get the functionality you are after.

However I think that you would be trying to fit a square peg into a
round hole. How about just putting a text box control on the form,
then place a button control next to it that has a down arrow image on
it ? Then on the 'on click' event of the button show the form.

Nov 21 '05 #3

P: n/a
"Brian Henry" <no****@nospam.microsoft.com>'s wild thoughts
were released on Wed, 20 Jul 2005 11:06:43 -0400 bearing the
following fruit:
Is there anyway to prevent the white box that drops down when you do a
combobox dropdown from showing? I am trying to make a custom combobox which
requires showing a custom form in its place, but the white box shows up
still ontop of the new form that is taking its palce even though there is no
items in the white box. Any windows messages or anything you can trap or
whatnot? thanks!


You would make a usercontrol inherited from the combobox
then capture the messages to the combo box and intercept any
message that would result in the combobox showing it's
dropdown and instead show your own. So you'll need to
capture mouseclicks and the f4 key being pressed.

If you implement IMessageFilter you can capture the F4 key
and use Sub WndProc to capture the mouse events. I can't
remember why you can't capture the F4 key here too.

Sorry I can't be of more help, I can't find the article I
read about this so I'm going from memory.


Jan Hyde (VB MVP)

--
A man is incomplete until he is married.
After that, he is finished.

(Zsa Zsa Gabor)

[Abolish the TV Licence - http://www.tvlicensing.biz/]

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.