473,387 Members | 1,540 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,387 software developers and data experts.

Intercepting closing DropDown of a ComboBox

Good morning

I've not found an event that notify me when drop-down part of a BomboBox is
closed. OnDropDown just notify when the drop-down is displayed, not when it
is closed.

Is there a message in WndProc that can be used to intercept a drop-down
closing?

Thank you very much.

Carlo


-------------------------------------------
Carlo, MCP (Windows Based Applications)
ca************@gmail.com

Nov 23 '05 #1
5 3658
"Carlo" <ca************@gmail.com> schrieb:
I've not found an event that notify me when drop-down part of a BomboBox
is closed. OnDropDown just notify when the drop-down is displayed, not
when it is closed.

Is there a message in WndProc that can be used to intercept a drop-down
closing?


Listen for 'WM_COMMAND' of the parent window and check if 'wParam''s
high-order word is 'CBN_CLOSEUP'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #2
Hello Herfried,
thank you for your help.

The problem is that I don't have a parent window available (do you means
parent form?) because I'm working on a control that inherits from
System.Windows.Forms.ComboBox.
I checked all messages raised by WndProc of my ComboBox, but I've seen any
WM_COMMAND.

Carlo

-------------------------------------------
Carlo, MCP (Windows Based Applications)
ca************@gmail.com
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> ha scritto nel
messaggio news:uB*************@TK2MSFTNGP10.phx.gbl...
"Carlo" <ca************@gmail.com> schrieb:
I've not found an event that notify me when drop-down part of a BomboBox
is closed. OnDropDown just notify when the drop-down is displayed, not
when it is closed.

Is there a message in WndProc that can be used to intercept a drop-down
closing?


Listen for 'WM_COMMAND' of the parent window and check if 'wParam''s
high-order word is 'CBN_CLOSEUP'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #3

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uB*************@TK2MSFTNGP10.phx.gbl...
"Carlo" <ca************@gmail.com> schrieb:
I've not found an event that notify me when drop-down part of a BomboBox
is closed. OnDropDown just notify when the drop-down is displayed, not
when it is closed.

Is there a message in WndProc that can be used to intercept a drop-down
closing?


Listen for 'WM_COMMAND' of the parent window and check if 'wParam''s
high-order word is 'CBN_CLOSEUP'.

--


No need to use the parent window. All WM_COMMAND and WM_NOTIFY
messages are reflected to the control itself. Use this:

http://groups.google.se/group/micros...581d8d1f?hl=sv
/claes
Nov 23 '05 #4
This is exactly what I was searching for!

Thank you to Herfried and thank you to Claes.

Carlo
-------------------------------------------
Carlo, MCP (Windows Based Applications)
ca************@gmail.com
"Claes Bergefall" <cl*************@nospam.com> ha scritto nel messaggio
news:%2****************@TK2MSFTNGP15.phx.gbl...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uB*************@TK2MSFTNGP10.phx.gbl...
"Carlo" <ca************@gmail.com> schrieb:
> I've not found an event that notify me when drop-down part of a
> BomboBox
> is closed. OnDropDown just notify when the drop-down is displayed, not
> when it is closed.
>
> Is there a message in WndProc that can be used to intercept a drop-down
> closing?


Listen for 'WM_COMMAND' of the parent window and check if 'wParam''s
high-order word is 'CBN_CLOSEUP'.

--


No need to use the parent window. All WM_COMMAND and WM_NOTIFY
messages are reflected to the control itself. Use this:

http://groups.google.se/group/micros...581d8d1f?hl=sv
/claes

Nov 23 '05 #5

"Claes Bergefall" <cl*************@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uB*************@TK2MSFTNGP10.phx.gbl...
"Carlo" <ca************@gmail.com> schrieb:
I've not found an event that notify me when drop-down part of a BomboBox is closed. OnDropDown just notify when the drop-down is displayed, not
when it is closed.

Is there a message in WndProc that can be used to intercept a drop-down closing?
Listen for 'WM_COMMAND' of the parent window and check if 'wParam''s
high-order word is 'CBN_CLOSEUP'.

--


No need to use the parent window. All WM_COMMAND and WM_NOTIFY
messages are reflected to the control itself. Use this:

http://groups.google.se/group/micros...581d8d1f?hl=sv

/claes


Just an addition. The above solution requires that you inherit the combobox
If you, for some reason, don't want to inherit it, use Herfried's suggestion
(the parent being the Form/Panel/whatever that the combobox is placed on)

/claes
Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
2
by: kate sporks | last post by:
I have the following issue with a ComboBox, specifically a dropdown list. When the dropdown is shown, the items spill over the right edge of the screen. Basically, the dropdown is about 30 pixels...
1
by: Norm Katz | last post by:
When you use a bound combobox and you set its dropdown style to "dropdown" that allows you to enter text in the edit box. But if you enter anything other than a value in the current bound items...
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...
3
by: Peter Proost | last post by:
Hi I have made my own control with a dropdown functionality like a combobox and it works just great, but I've got one problem remaining. If you put a combobox on a panel and press the little arrow...
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...
4
by: AccessRookie | last post by:
Ok, I am pretty new to Access (Using Access 2002 at my job). Here is what I want to do. I want to create a database that has a form. On this form will be a dropdown menu (combobox). Depending...
2
by: Vidhura | last post by:
My application contains 2 tabpages.The second tabpage contains panel .The panel contains series of combobox and textboxes. If the item not selected in combobox and the user click on the another...
2
by: Andrus | last post by:
SWF DataGridView contains combobox control. Activating combobox and pressing F4 to open dropdown menu causes strange NRE (see below). When I enter some valid value to combobox, press tab,...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.