LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to detect mouse over event for controls inside a tab control?

Solved!
Go to solution

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?

0 Kudos
Message 1 of 8
(5,635 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(5,628 Views)

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.

 

MouseOverTabs.png

 

(pardon the overlaps - it loses the link to the control when creating a snippet)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 8
(5,624 Views)

@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.

0 Kudos
Message 4 of 8
(5,584 Views)
You should also be able to get a reference to the control by right clicking on it and selecting Create Reference.

Mike...

PS: best solution would involve losing the tab control.

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 8
(5,553 Views)

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.

0 Kudos
Message 6 of 8
(5,538 Views)
Solution
Accepted by topic author zomboy_

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.


___________________
Try to take over the world!
0 Kudos
Message 7 of 8
(5,516 Views)

 

@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!

0 Kudos
Message 8 of 8
(5,503 Views)