04-23-2007 10:54 AM
04-23-2007 11:22 AM
04-24-2007 12:22 AM
@Mountain_jr wrote:
Hello ,I want to know which button is pressed on my "Tab control"For example:I have 3 buttons on my front panel and want to use the "event structure" to dectect wich button is pressed.We don't use the "Value Change" option becaurse we have the added all buttons.We want do do this with +/- 80 buttons.
Michael,
See the Question in the Title of the post & the Question you have asked. Both are mutually exclusive, not related at all !
Be clear whether you want the answer for Key pressed on Tab or button pressed/clicked on Tab.
Both are seperate events, Key Down & Mouse Down for the Tab control.
You can get which Mouse button is Clicked on the Tab control, by configuring the Mouse Down event for the Tab control.
But Key Down event fot the Tab control wont work (for that matter for any Control), unless & until that particular control has got KeyFocus on it.
To get the KeyDown event for Tab control working properly, you need to set its KeyFocus to True in the Timeout event.
Else even if you dont wish to set the Tab control with its KeyFocus, but still want to configure some KeyDown code working, the all you have to do is to code the in the KeyDown event of the Vi itself. This will take care whenever you press a key.
See the attached VIs to get a clear understanding of what I mean.
04-24-2007 12:35 AM
One way to do this is to register for Value change on all the controls on the tab control page, and then use the control reference in the event structure to determine which was hit.
Using the Register for events node, you can register for all the control value changes at once even!
Here is a simple example that I hope gives you an idea of what I mean
04-24-2007 02:15 AM
Hello all,
Thank you for your quick response.
This is the solution for our application. We are going to implement that one.
Thanks,
Michael van den Berg