Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / November 2005

Tip: Looking for answers? Try searching our database.

Intercepting closing DropDown of a ComboBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carlo - 16 Nov 2005 10:32 GMT
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)
carlodevREMOVE@gmail.com
Herfried K. Wagner [MVP] - 16 Nov 2005 11:10 GMT
"Carlo" <carlodevREMOVE@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'.

Signature

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

Carlo - 16 Nov 2005 11:57 GMT
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)
carlodevREMOVE@gmail.com

> "Carlo" <carlodevREMOVE@gmail.com> schrieb:
>> I've not found an event that notify me when drop-down part of a BomboBox
[quoted text clipped - 6 lines]
> Listen for 'WM_COMMAND' of the parent window and check if 'wParam''s
> high-order word is 'CBN_CLOSEUP'.
Claes Bergefall - 17 Nov 2005 08:53 GMT
> "Carlo" <carlodevREMOVE@gmail.com> schrieb:
> > I've not found an event that notify me when drop-down part of a BomboBox
[quoted text clipped - 6 lines]
> 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/microsoft.public.dotnet.framework.windowsforms/msg
/579c8133581d8d1f?hl=sv


   /claes
Claes Bergefall - 17 Nov 2005 09:50 GMT
> > "Carlo" <carlodevREMOVE@gmail.com> schrieb:
> > > I've not found an event that notify me when drop-down part of a BomboBox
[quoted text clipped - 9 lines]
> 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/microsoft.public.dotnet.framework.windowsforms/msg
/579c8133581d8d1f?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
Carlo - 17 Nov 2005 09:50 GMT
This is exactly what I was searching for!

Thank you to Herfried and thank you to Claes.

Carlo

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

>> "Carlo" <carlodevREMOVE@gmail.com> schrieb:
>> > I've not found an event that notify me when drop-down part of a
[quoted text clipped - 14 lines]
>
>    /claes

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.