LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enable and disable events programatically

hi.
i use event case and i want to enable and disable some events programatically. for example sometimes i want to have an event for a button and sometimes i don't want. how can i do this?
 
thanks.
ali mootab.
0 Kudos
Message 1 of 7
(4,049 Views)
A simple solution could be to place the event operations in a case structure, as in the attached example.
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 7
(4,033 Views)


@ali mootab wrote:
hi.
i use event case and i want to enable and disable some events programatically. for example sometimes i want to have an event for a button and sometimes i don't want. how can i do this?

Another approach would be to set the Disabled property of the control in question.
0 means enabled, 1 means disabled and 2 means diasbled & grayed out.

Usually 0 and 2 are the most used since it is a good idea to give the user some feedback that a control is not currently operable.

Rolf Kalbermatter

Message Edited by rolfk on 04-16-2006 08:12 PM

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 7
(4,026 Views)


rolfk a écrit:...Another approach would be to set the Disabled property of the control in question.


Sorry rolfk, but the Disabled property doesn't affect the response to events (at least on my Mac...). The mouse down event is generated even with a grayed button. And this looks normal to me 😉
Chilly Charly    (aka CC)
0 Kudos
Message 4 of 7
(4,019 Views)


rolfk a écrit:...Another approach would be to set the Disabled property of the control in question.


Sorry rolfk, but the Disabled property doesn't affect the response to events (at least on my Mac...). The mouse down event is generated even with a grayed button. And this looks normal to me 😉
Chilly Charly    (aka CC)
0 Kudos
Message 5 of 7
(4,018 Views)

Hi Ali,

      Not to beat this to death, but in fact you can enable/disable events programmatically. Smiley Happy

Cheers.

 

When they give imbeciles handicap-parking, I won't have so far to walk!
Message 6 of 7
(4,014 Views)


@chilly charly wrote:


rolfk a écrit:...Another approach would be to set the Disabled property of the control in question.


Sorry rolfk, but the Disabled property doesn't affect the response to events (at least on my Mac...). The mouse down event is generated even with a grayed button. And this looks normal to me 😉

If you use mouse events then yes you are right. But usually it is about the Commit or Value Changed event and here Enable/Disable works perfect.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 7 of 7
(4,001 Views)