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 / Languages / VB.NET / August 2006

Tip: Looking for answers? Try searching our database.

how to make a mouseup event called only once during a double click event?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Techsatish - 25 Aug 2006 17:47 GMT
how to make a mouseup event called only once during a double click
event?
here double click is made on a tree node in a tree control.

I have the code inside mouseup event....in runtime the mouseup is
called twice for the mouse double click over the selected tree node.

I want mouseup event to be called onece

Any ideas?

TIA
Satish
Ken Halter - 25 Aug 2006 18:32 GMT
> how to make a mouseup event called only once during a double click
> event?
[quoted text clipped - 9 lines]
> TIA
> Satish

I'm just a visitor around here, but you seem to be trying to fight a design
that's been in place for around two decades. Mouse Up fires every time you
release the mouse button.

I dropped a textbox on a form in VB6, added a few debug.prints and got the
following output when I double-clicked.... (fwiw, the numbers are just the
VB timer value at the time)

'Form1:Text1_MouseDown       37502.56
'Form1:Text1_MouseUp         37502.64
'Form1:Text1_Click           37502.64
'Form1:Text1_DblClick        37502.71
'Form1:Text1_MouseUp         37502.81

So, if you're processing in MouseUp, seems like setting a boolean variable
called "ProcessMouseUp" or something similar = True in MouseDown and testing
that variable in MouseUp would be easy enough. Once the code in MouseUp
runs, reset that bool to False. Since MouseDown fires only once, the next
time MouseUp fires, your test should determine whether or not to take
action.

Signature

Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm

Techsatish - 28 Aug 2006 14:58 GMT
Thanks Ken It works!
-Satish

> > how to make a mouseup event called only once during a double click
> > event?
[quoted text clipped - 35 lines]
> Please keep all discussions in the groups..
> In Loving Memory - http://www.vbsight.com/Remembrance.htm
gene kelley - 25 Aug 2006 19:55 GMT
>how to make a mouseup event called only once during a double click
>event?
[quoted text clipped - 9 lines]
>TIA
>Satish

If you are using the VB2005 TreeView control, you should look at using the NodeMouseClick and/or the
NodeMouseDoubleClick events rather than the standard Mouse Events.

Gene

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.