473,766 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox drop-down window closing/hidden

I am trying to get an event when the drop-down Combo Box goes away /
reverts back to showing a single item.

For example, clicking the box's down arrow, to remove the drop-down
window, doesn't seem to generate any event. Not even a mouse event.
That seems a little odd.

Besides not finding a public event method, I can't seem to find a
protected method to over-ride either.

I am guessing I need to look for a message in ComboBox's WndProc().
But I don't know which message is the one I'm looking for.

Any ideas ?

Thanks...
Mar 21 '08 #1
3 3542
On Mar 21, 10:00 am, - HAL9000 <gu...@mail.org wrote:
I am trying to get an event when the drop-down Combo Box goes away /
reverts back to showing a single item.

For example, clicking the box's down arrow, to remove the drop-down
window, doesn't seem to generate any event. Not even a mouse event.
That seems a little odd.

Besides not finding a public event method, I can't seem to find a
protected method to over-ride either.

I am guessing I need to look for a message in ComboBox's WndProc().
But I don't know which message is the one I'm looking for.

Any ideas ?

Thanks...
DropDownClosed event of combobox must be what you're looking for.
Mar 21 '08 #2
On Fri, 21 Mar 2008 02:32:01 -0700 (PDT), kimiraikkonen
<ki************ *@gmail.comwrot e:
>On Mar 21, 10:00 am, - HAL9000 <gu...@mail.org wrote:
>I am trying to get an event when the drop-down Combo Box goes away /
reverts back to showing a single item.

For example, clicking the box's down arrow, to remove the drop-down
window, doesn't seem to generate any event. Not even a mouse event.
That seems a little odd.

Besides not finding a public event method, I can't seem to find a
protected method to over-ride either.

I am guessing I need to look for a message in ComboBox's WndProc().
But I don't know which message is the one I'm looking for.

Any ideas ?

Thanks...

DropDownClos ed event of combobox must be what you're looking for.
Ahh, I see they added DropDownClosed( ) event for .net version 2. I
have to use version 1, so I can't use that.

That tip did lead me to the information I needed though (eg
CBN_CLOSEUP message):

http://groups.google.com/group/micro...74deef8895fc73
Changed that around a little to:

Protected Overrides Sub WndProc(ByRef m As
System.Windows. Forms.Message)
'WM_USER As Integer = &H400
'OCM__BASE As Integer = WM_USER + &H1C00
'WM_COMMAND As Integer = &H111
'OCM_COMMAND As Integer = OCM__BASE + WM_COMMAND
If m.Msg = (&H400 + &H111 + &H1C00) Then
Debug.WriteLine ("WndProc Msg = " & Hex(m.Msg) & "h, LParam =
" & Hex(m.LParam.To Int32) & "h, WParam = " & Hex(m.WParam.To Int32) &
"h, HWnd = " & Hex(m.HWnd.ToIn t32) & "h")
If (m.WParam.ToInt 32 And &HF0000) = &H80000 Then
Debug.WriteLine ("drop down window close message")
OnDropDownWindo wClose(System.E ventArgs.Empty)
End If
End If
MyBase.WndProc( m)
End Sub

Protected Overridable Sub OnDropDownWindo wClose(ByVal e As
System.EventArg s)
RaiseEvent DropDownWindowC lose(Me, e)
End Sub

Public Event DropDownWindowC lose As EventHandler

Mar 21 '08 #3
On Mar 21, 11:21*pm, - HAL9000 <gu...@mail.org wrote:
On Fri, 21 Mar 2008 02:32:01 -0700 (PDT), kimiraikkonen

<kimiraikkone.. .@gmail.comwrot e:
On Mar 21, 10:00 am, - HAL9000 <gu...@mail.org wrote:
I am trying to get an event when the drop-down Combo Box goes away /
reverts back to showing a single item.
For example, clicking the box's down arrow, to remove the drop-down
window, doesn't seem to generate any event. *Not even a mouse event.
That seems a little odd.
Besides not finding a public event method, I can't seem to find a
protected method to over-ride either.
I am guessing I need to look for a message in ComboBox's WndProc().
But I don't know which message is the one I'm looking for.
Any ideas ?
Thanks...
DropDownClosed event of combobox must be what you're looking for.

Ahh, I see they added DropDownClosed( ) event for .net version 2. *I
have to use version 1, so I can't use that.

That tip did lead me to the information I needed though (eg
CBN_CLOSEUP message):

http://groups.google.com/group/micro...languages.vb/m...

Changed that around a little to:

* *Protected Overrides Sub WndProc(ByRef m As
System.Windows. Forms.Message)
* * * 'WM_USER As Integer = &H400
* * * 'OCM__BASE As Integer = WM_USER + &H1C00
* * * 'WM_COMMAND As Integer = &H111
* * * 'OCM_COMMAND As Integer = OCM__BASE + WM_COMMAND
* * * If m.Msg = (&H400 + &H111 + &H1C00) Then
* * * * *Debug.WriteLin e("WndProc Msg = " & Hex(m.Msg) & "h, LParam =
" & Hex(m.LParam.To Int32) & "h, WParam = " & Hex(m.WParam.To Int32) &
"h, HWnd = " & Hex(m.HWnd.ToIn t32) & "h")
* * * * *If (m.WParam.ToInt 32 And &HF0000) = &H80000 Then
* * * * * * Debug.WriteLine ("drop down window close message")
* * * * * * OnDropDownWindo wClose(System.E ventArgs.Empty)
* * * * *End If
* * * End If
* * * MyBase.WndProc( m)
* *End Sub

* *Protected Overridable Sub OnDropDownWindo wClose(ByVal e As
System.EventArg s)
* * * RaiseEvent DropDownWindowC lose(Me, e)
* *End Sub

* *Public Event DropDownWindowC lose As EventHandler- Hide quoted text -

- Show quoted text -
I think it's your time to jump .net 2.0 at least. DropDownClosed is
well-wrapped event rather than writing low-level Win32 API calls as
you described above.
Mar 21 '08 #4

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

Similar topics

5
308
by: Jade | last post by:
Hi, i wanted to know how i can make a combo readonly. at the moment the user can edit the values in the combobox at runtime
2
2119
by: NewSun | last post by:
The combobox can drop and be selected,but the display member or text showing can't be edit. Thanks in advance.
3
6834
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article: http://msdn.microsoft.com/msdnmag/issues/03/08/DataGrids/default.aspx I have a problem when there are two DataGrid's on one form, and when I switch focus from one grid to the other. To be more precise, when I'm editing a combo box column in one grid, and then click in the combo column of...
3
4586
by: amber | last post by:
Hello, I have 6 comboboxes, that I thought I could bind to the same datasource, and have them display different 'selectedvalue's', but apparently I can't... My code is as follows: dim drv as datarowview = me.listbox1.selecteditem dim dtbDL as datatable = _dataset1.Tables(0) dim dtvDL as new dataview(dtbDL) dtvDL.RowFilter = "STR_ONE" = 'Matching Text'"
4
1818
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection, configured, dragged an Dataadapter per each table I need it, then generated the dataset, after that, I stablished the relations between tables, then, went over to the datasources, choose the parent datasource and clicked on the + sign, it...
1
1723
by: Drakemar | last post by:
What I thought was a real simple thing to do has out not to be. I have a real simple Access database with two tables: Student Table id (autonumber) *primary key* name (text) teacherID (int) *foreign key* Teacher id (autonumber) *primary key* relationship to Student.teacherID
1
374
by: Ferdinand Zaubzer | last post by:
Hello, I am trying to insert some Text via drag and drop into the editable area of a combobox. The problem is, that I can't get the current charIndex of the selected Text via the mouse cursor location. Is there any way to do that or is it not possible? Thanks Ferdinand
3
1009
by: bh | last post by:
I'm trying to define a combobox on a form and make it accessible to another form. I drop the control onto the form in Visual Studio (2003), but when I go into the code-behind and add the "shared" keyword, the control disappears from the form. Can comboboxes be shared? What else could be causing this? Thanks in advance. bh
0
2470
by: alexia.bee | last post by:
Hi All, I am trying to get the index of an item that the mouse is pointing/ hovering at. Meaning, when user click the Combobox, droplist is show. When you hover the mouse on item, it highlight it. I want to get the item's index which the mouse is pointing at. The problem is that I didn't find any event that been fired when mouse highlightd/hover to other item in the drop downlist of the Combobox.
1
875
by: GS | last post by:
I got a detailed view of bound sql dataset table. what is the best ways to allow user to select values via combobox on some of the table columns? O know a way of using another table from the same dataset but that requires me adding extra combo box and event to link the change in the comboboxes back to the actual table columns to be updated. I also notice that there is a style of combobox box in the detail table column in the designer...
0
10168
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10009
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9838
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8835
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.