473,385 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

preventing combobox dropdown box from showing

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
3 1741
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jean | last post by:
hi: 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,...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
7
by: NCrum | last post by:
I want to set the Default value of a Combobox for any changeable record and have got this working but it is totaly unsatisfactory see the code below I loop through the items in the Combo looking...
2
by: Anand | last post by:
Hi All, I have a combobox with style as DropDown List. When I set the combobox.selectedIndex = 0, the first value is not showing up in the combobox and it is simply blank. Only if I...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
3
by: Brian Henry | last post by:
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...
5
by: Peter Stojkovic | last post by:
VB 7.1 and windows.forms. I have a comboBox on a form. When the user goes with TAB-Key to the comboBox, the comboBox should dropDown the ListBox automatically and show ALL entries. The user...
5
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
9
by: Franky | last post by:
I have a usercontrol that inherits from ComboBox I'd like to add the feature that the user can delete any item Best would be that he could right click an element and a messagebox would ask if...
2
by: gleadams | last post by:
I have databound a Windows form ComboBox control to a DataSource and DataMember and it is properly showing the data as I navigate through the records. My question concerns the choices in the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.