LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic event registration wont work with Tab control

In LTR volume 11 No1 we find the "Dynamic Event Handling.vi".
I had placed the controls on a Tab control and now this example wont work.
Is there a solution to this problem?
Scientia est potentia!
0 Kudos
Message 1 of 2
(2,695 Views)
Yes. The first stage of the code registers mouse down events for all the controls. When you added a tab control that meant that a mouse down event was registered for the tab as well. So now when you click on an object on the tab LabVIEW must decide whether to fire the mouse down on the tab-event, or the mouse down on the object on the tab event...It goes for the first but since there is no description for the tab no dialog will be displayed. If you add a description for the tab you'll see that it fires the event with the tab and you get a dialog with the tab description.

So - how to fix. Well, it's not that simple, one might think that to exclude the reference to the tab when you register the events would do the trick, but it rather seems that LV will always t
hink mouse clicks are on the tab and not on the objects on the tab.

The solution though is to get the references to the objects by reading the controls on page property of the tab control. So instead of reading the controls array from the front panel read the pages references of the tab and then the controls on page array from that and then register mouse down events on that array.
Message 2 of 2
(2,695 Views)