12-22-2015 08:01 AM
I need to change the mouse pointer as it moves over controls which are located in tabs.
Now when the mouse moves over to the tab, LABVIEW does not detect the controls saperately for mouse over event.
Is there a way to do what I intend to do?
Solved! Go to Solution.
12-22-2015 08:09 AM
I'd like to see your code because we do this exact thing. Specifically, we use the Mouse Enter and Mouse Leave events to change the mouse pointer depending on what it is over.
12-22-2015 08:13 AM - edited 12-22-2015 08:14 AM
What are you doing in your code? You can statically register for the mouse enter / mouse leave event on individual controls, and you can get a reference to all of the controls on each page of the tab control to dynamically register the events, so it's definitely possible.
(pardon the overlaps - it loses the link to the control when creating a snippet)
12-22-2015 12:15 PM
@Sam_Sharp wrote:
(pardon the overlaps - it loses the link to the control when creating a snippet)
Use the Code Capture Tool. It doesn't break links the way the built-in VI snippet tool does.
12-22-2015 08:26 PM
12-22-2015 10:18 PM
Here's the part where I do the pointer changing. I tried to remove the Tab reference from the array of control references but that also did not work.
12-23-2015 01:26 AM
Your problem is with the Panel.Controls[] property. It does not return controls which are inside containers (arrays, tabs, clusters) and only returns the container itself. As Sam showed, if you want the references of the controls in the tab, you need to get the references of the pages and get the controls in each page and add those to your original array and do this recursively.
You can either write a VI to do this (or look it up. There have been VIs posted here which recursively parse the FP for all control references) or just do it statically for this one tab control and move on. There's also a VI shipping with LV which can help with this, but I suggest you not use it, as it will be tricky to get it to work if you build an EXE.
And I would also recommend the Code Capture Tool.
12-23-2015 02:43 AM
@tst wrote:
Your problem is with the Panel.Controls[] property. It does not return controls which are inside containers (arrays, tabs, clusters) and only returns the container itself. As Sam showed, if you want the references of the controls in the tab, you need to get the references of the pages and get the controls in each page and add those to your original array and do this recursively.
You can either write a VI to do this (or look it up. There have been VIs posted here which recursively parse the FP for all control references) or just do it statically for this one tab control and move on. There's also a VI shipping with LV which can help with this, but I suggest you not use it, as it will be tricky to get it to work if you build an EXE.
And I would also recommend the Code Capture Tool.
This works like a charm. Thanks!