ComboBox - mousedoubleclick event

E

Ed Cohen

I am having trouble getting any of the combo boxes to respond to a mouse
double click. Nothing happens! I do get a response using the mousedown event,
but not a mousedouble click event. I am using VS 2005, VB.NET. I had no
problem with Access VBA 2000 with this kind of event.

I have tried doing it manually. Here is the code:

In the form load event

AddHandler ChurchComboBox.MouseDoubleClick, AddressOf ComboBoxDoubleClick



Private Sub ComboBoxDoubleClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ChurchComboBox.MouseDoubleClick
MessageBox.Show("church")
End Sub

But nothing ever happens. I can get text boxes to respond to a double click
event, but never any combo boxes. Is there something I have forgotten?

Ed Cohen
 
G

GS

Mine works, but I don't see any difference in the signature of your event
handler
Private Sub TestINetAddress_MouseDoubleClick(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
TestINetAddress.MouseDoubleClick

However if you already specify handles cause in your event sub, I failed to
see the need for
addhandler part


If all else failed, remove addhandler, go to events tab of your
ChurchComboBox in the designer, remove the spec from doubleclick event,,
single click another event, then add the comboxMouseClick back in for
mousedoubleclick. That tend to reset the declaration for the combobox to
have withevents clause...

Btw, unless your doubleclick handles other combobox, I would name according
to the usual convention
ChurchComboBox_MouseDoubleClick

<Snip
AddHandler ChurchComboBox.MouseDoubleClick, AddressOf ComboBoxDoubleClick



Private Sub ComboBoxDoubleClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ChurchComboBox.MouseDoubleClick
MessageBox.Show("church")
End Sub
<snip>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top