12-12-2011 11:22 AM
Hi,
I have created an XControl and I would like to disable it that value changed event can not be triggered. But if I disable it with disable property, I can still generate event (see attached example).
How can I disable XControl that it won't be responsive anymore?
Thanks,
andrej
Solved! Go to Solution.
12-12-2011 01:07 PM
andrej,
The button is not "responsive" in the sense that when you press it, the value changes. What exactly are you trying to do? You can always use a property node to determine if the button is disabled and handle it accordingly.
I think if you provide a little more information, then we might be able to help you out, but as it is, the value change event will respond regardles of the disabled state and I don't believe that there is much you can do about this.
Cheers, Matt
12-12-2011 01:08 PM
Your facade VI has a "Mouse Up" event handler where you set the "Data Changed" flag. Not sure what you meant that for, but if you remove that event case or set the flag false, that should fix it.
12-12-2011 11:10 PM
I'm trying to achive the same behaviour like any standard button has. For example, if I put OK button from modern panel on front panel of VI and disable it, no event is generated if I click on it. But the event is generated if I click my XControl button (when it is disabled). Why is this behaviour diferent between the two buttons?
12-12-2011 11:22 PM
Not true.
Even normal buttons on the front panel will still trigger events for mouse up and mouse down even if they are disabled.
12-12-2011 11:24 PM
Ok. What about value changed event? Because in that is the difference between my XControl button and a regular button.
12-12-2011 11:34 PM
Disabled on a regular button would prevent a value changed event from occurring (although a Value (signalling) property node would still fire it) since the disabled state prevents the user from changing the value from the front panel. It just doesn't disable mouse events on the control.