Single click stops double-click working?? Help??

S

Siv

Hi,
I have a ListView control in a Windows application, currently single
clicking a customer name in this list, selects the customer and displays
their details in text boxes to the right of the list. The user must then
click a button to select that customer and move off the page to the main
database details. I would like to implement being able to double-click the
listview item and it have the same effect as single clicking and then
pressing the button.

My problem is that I can't get the double-click event to fire, the
single-click always gets in first??

How do I tell the control that if the two clicks are in close succession it
is a double-click not two single clicks??

I thought the system would go with the double-click if the clicks were
within the timeframe specified in the control panel for a double-click??
 
G

Guest

i do exactly what you describe with pretty much all of my listview's, so it
should work. are you using the DoubleClick event? you may also be doing
something wierd inside MyListView_Click that prevents a DoubleClick from
being generated

Private Sub MyListView_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyListView.DoubleClick
On Error Resume Next
MyButton_Click(sender, e)
End Sub

Private Sub MyButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyButton.Click
'do stuff
End Sub
 
I

Inge Henriksen

If you have trouble getting it to work, then try to bubble the event using:

RaiseBubbleEvent(Me, e)


"Dave Cousineau ( Sahuagin )"
 
I

Inge Henriksen

Check that "Handles MyListView.DoubleClick" is attached to the appropriate
function decleration. Some versions of the Visual Studio IDE sometimes
creates event handlers without these "Handles" attached, thus the event will
never be called.

Example of usage:

Private Sub MyListView_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyListView.DoubleClick
MsgBox ("Hello world!")
end sub
 

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