LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

detecting double click on a botton

hello,

I was wondering if anyone knew how to detect a double click on a button.
I'd like to allow the user the ability to toggle the button state to enable
a particular line or double click on the button to access further
properties.

I'm running LV 5.1.1 on a Windows 98 machine.

all info greatly appreciated,
-- William --
0 Kudos
Message 1 of 3
(2,456 Views)
<< I was wondering if anyone knew how to detect a double click on a button.
>>

Hi Will,

as far as I know the only front panel element that supports a "native"
double-click detection with LV 5.1.1 is the list box control. But I assume
that with my first thought, "Create a transparent listbox over the button
and detect/redirect its clicks to..." you'll run into serious workload.

In my opinion a better workaround could be to measure the time between 2
clicks on the button. Let the user set an "attention flag" with a simple
click - and if no following click is detected after, let's say, 200 ms with
the attention flag set, this click is interpreted as a single one. Otherwise
it *is* a double click!
This should work fine - but only, if your VI itself is executed
fast enough
to allow 2 clicks in (here) 200 ms!

Greetings,
Hans
0 Kudos
Message 2 of 3
(2,456 Views)
William,

I found two examples that may get you started on this. The first is a windows
message queueing utitliy that you should be able to use to montitor events:
http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&F81544D8F66360308625683A000CB6A7

The second uses this utility to determine when a user clicks (single) on
a control, I think the array input into the first queue VI determines what
events you wish to monitor.

http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&F7DAD5C6404427AA862568890001D5E0

Hope that helps. The code does more than just message queuing, there seems
to be some image mapping going to determine when sombody is over a control
etc.

Cheers,
Kamran
"william doggett" wrote:
>hello,>> I was wondering i
f anyone knew how to detect a double click
on a button.>I'd like to allow the user the ability to toggle the button
state to enable>a particular line or double click on the button to access
further>properties.>> I'm running LV 5.1.1 on a Windows 98 machine.>>
all info greatly appreciated,>
-- William -->>
0 Kudos
Message 3 of 3
(2,456 Views)