473,387 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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

Aug 25 '06 #1
3 3556
"Techsatish" <te********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
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
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.

--
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
Aug 25 '06 #2
On 25 Aug 2006 09:47:44 -0700, "Techsatish" <te********@gmail.comwrote:
>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
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
Aug 25 '06 #3
Thanks Ken It works!
-Satish

Ken Halter wrote:
"Techsatish" <te********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
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

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.

--
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
Aug 28 '06 #4

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

Similar topics

0
by: Mark Schwarz | last post by:
Hello everyone, I've a problem using SetCapture and MouseUp events. I've done an app that is doing SetCapture(Handle) on a buttonclick event and have a mouseup event that shows a MessageBox and...
5
by: Tim Bücker | last post by:
Hello. I have a window form with some panels on it. In one panel I am using the OnMouseDown and OnMouseUp events. MouseDown initiates some things and MouseUp releases some things - so it is...
7
by: Sue & Bill | last post by:
Does a double click action also generate two MouseUp events? If so, what is a good method in my MouseUp event handler to detect that a MouseUp is part of a double click action? Thanks in...
2
by: dave.wayne | last post by:
In a web page I have a div tag that has a onlick event registered through the event listener. However, that same div tag also has a onmousedown - start a drag and drop script The problem I am...
6
by: Ian Boyd | last post by:
Every time during development we had to make table changes, we use Control Center. Most of the time, Control Center fails. If you try to "undo all", it doesn't, and you end up losing your identity...
2
by: techsatish | last post by:
Hi, I want the double click event to call(here not able to get the MouseEventArgs) and execute the mouseup event code or any one tell me how to make my treecontrol double click nodes to behave...
2
by: charlieopenshaw | last post by:
I have a form listview and have used the MouseDown event to launch a modal dialog if a particular cell is clicked. This works fine but upon closing the dialog I am left with a dotted rectangle...
2
by: Max2006 | last post by:
Hi, I have a simple form with a button on it. After a button click postback, anytime user press F5 (browser page refresh), the button's OnClick event handler is called again without the button...
12
by: Tom Bean | last post by:
I am trying to display a ContextMenuStrip when a user right-clicks on an item in a ListView and have encountered a something that seems strange to me. When the ListView is initially populated,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.