|
-
August 25th, 2008, 06:24 AM
#1
Problem with Mouse events
Hi friends,
I had a problem while handling mouse events.
I am using a listview control of vb2005.
My requirement is to have different results when the listview item is clicked and when it doubleclicked..
i am using listview_mouseclick and listview_mousedoubleclick events..
but when i tried to doubleclick the mouse for the first click itself the listview_mouseclick event is raising...
Please help me out to over come this situation and handle the events correctly
-
August 25th, 2008, 06:26 AM
#2
Re: Problem with Mouse events
Try using the Click And DBlClick events, rather than MouseClick and MouseDblClick.
Help from me is always guaranteed!*
VB.NET code is made up on the spot with VS2008 Professional with .NET 3.5. Everything else is just made up on the spot.
Please Remember to rate posts, use code tags, send me money and all the other things listed in the "Before you post" posts.
*Guarantee may not be honoured.
-
August 25th, 2008, 07:27 AM
#3
Re: Problem with Mouse events
yeah I tried but no use same response..
-
August 25th, 2008, 07:33 AM
#4
Re: Problem with Mouse events
It makes sense, I suppose.
What exactly are you doing in the events? Considering that a DblClick seems to require a click in the same place, could you undo whatever action the click performs in the DblClick event?
Help from me is always guaranteed!*
VB.NET code is made up on the spot with VS2008 Professional with .NET 3.5. Everything else is just made up on the spot.
Please Remember to rate posts, use code tags, send me money and all the other things listed in the "Before you post" posts.
*Guarantee may not be honoured.
-
August 25th, 2008, 08:19 AM
#5
Re: Problem with Mouse events
I'd suggest using only the click event. In there you could test if the Right button was pressed or the Left button. Then, you work with left & right clicks.
Just a dumb idea...
-
August 25th, 2008, 09:00 AM
#6
Re: Problem with Mouse events
 Originally Posted by HanneSThEGreaT
I'd suggest using only the click event. In there you could test if the Right button was pressed or the Left button. Then, you work with left & right clicks.
Just a dumb idea...
Not a dumb Idea at all. It fits the bill for this solution perfectly.
I would take it even further. Add a popup menu. That way, if you later find you need a third option, it would be easy to add in. Most people do very well with popups. And it might not be as intuitive as using right and left clicks.
-
August 25th, 2008, 09:06 AM
#7
Re: Problem with Mouse events
Of course, you can vary that slightly and go for the (possibly) more common option of (remembering this is in a ListView):
LeftClick = Select (Default in ListView)
RightClick = Select, Pop-Up Menu
DblClick = Select, Perform Default Action on item.
Help from me is always guaranteed!*
VB.NET code is made up on the spot with VS2008 Professional with .NET 3.5. Everything else is just made up on the spot.
Please Remember to rate posts, use code tags, send me money and all the other things listed in the "Before you post" posts.
*Guarantee may not be honoured.
-
August 26th, 2008, 02:49 PM
#8
Re: Problem with Mouse events
You could also declare a timer as a public variable and record the time every time the click event is fired.
If the timespan is too short, you exit the mouseclick procedure.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|