LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to know mouse click event on control

Hi,
  I have a very simple requirement. I have a 10 check box which I want to checked/unchecked if I checked/unchecked SelectAll check box.
  But I am facing one problem If user has checked the SelectAll checked box then all 10 checkbox geting checked and leater user unchecked any of 10 check box Then I want Select All check box should get unchecked . I am unable to do this.  I have attached the vi along with it for more clear view.
 
  I think I require to know mouse click event for that check box...Or is their any other way to do this?
 
 Thanks in advasnce,
 
 
Thanks:-
Mike
0 Kudos
Message 1 of 8
(7,392 Views)

I can't look at your code, but what you want is the event structure. You register a value change event for those controls and then you will have code which will execute only when their value will be changed by the user. You can find some examples in the example finder (Help>>Find Examples)

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(7,385 Views)

Hi tst,

  Thanks for suggestion I will definatly go through it. But at present can please tell me how to know the mouse click event for control. I am using base version 8.2 in which event structure is not provided? Please help me out.

 

Thanks:=-

Mike

0 Kudos
Message 3 of 8
(7,379 Views)


@MikeMike wrote:

I am using base version 8.2 in which event structure is not provided


That's a problem. Most of us are so used to events by now, that we forget they are not available in the base version (which in general seems fairly crippled).

I'm attaching a quick example (showing two ways of detecting changes), but this would turn ugly for a larger VI with more controls. If you want to do this with individual controls, you can build their values into an array. You can also use their references and run the code in a subVI, so that your UI VI is not too big.


___________________
Try to take over the world!
0 Kudos
Message 4 of 8
(7,371 Views)

Also, this is how it would look using events. Much better.

BTW, usually select all buttons have three states - none, partial and all. When the user selects or deselects some of the options, the button goes into partial mode and that way it can also be used for deselecting all the options.


___________________
Try to take over the world!
Message 5 of 8
(7,368 Views)

tst,

I tried without Event structure, seems to be pretty much difficult...

Can you please post the same thing done without ES ?

I tried different types of coding, including SRs, Array of booleans, then 10 Buttons built into as Array [as described by the original poster], etc... but in vain. Smiley Sad

I think that without ES, it is almost impossible. Now, a strong reason why ES are so handy in LabVIEW programming.

Can you please help ?

- Partha ( CLD until Oct 2027 🙂 )
Message 6 of 8
(7,364 Views)

Hi tst,

  Thanks for the help. I think this Events.llb I can use in my application. I will let you know if any problem comes across.

 

 

Thanks:-

Mike

0 Kudos
Message 7 of 8
(7,360 Views)


@parthabe wrote:

Can you please post the same thing done without ES ?


Look at reply #4. As you see, it's considerably less elegant, although there are probably better ways to handle this.

Mike, you can get this to work with a cluster of booleans by using Cluster to Array and Array to Cluster (you have to right click that one and set the cluster size). After converting you can type cast the cluster to your cluster to get the proper names.


___________________
Try to take over the world!
0 Kudos
Message 8 of 8
(7,350 Views)