473,441 Members | 1,348 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,441 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 3661
"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,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.