LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is control visible ?

At first I want to say that I DONT look for the property "visible"
I'm look for a way to ask a control if it is visible at present. I'm using TabControl and I would like to get FALSE if it is on a not selected page and TRUE if it is really visible that means "on top".

Is there a way to solve this problem ?
Ok, I know one way that would be looking for the control recursively in every TabControl but that wouldn't be very simple or quick in execution.
Has one of you a simple and quick solution for this problem ?

THANKS!
0 Kudos
Message 1 of 8
(3,283 Views)
But you know which tab the control is on so why not just check the value of the tab control...if it's the value of the tab the control is on then yes, the control is visible...

I would suspect there is a reason you can't do it that way though...if so - how come?
0 Kudos
Message 2 of 8
(3,283 Views)
that was my first idea but its very difficult and a lot (!!) of work because I'm working with 4 level of sub-controls und with about 50 or 100 or even more controls.

There is no simple way to get this information, is it ?
0 Kudos
Message 3 of 8
(3,283 Views)
Here is a method that may work, for you, however it depends on how "deep" the controls are.

One of the properties of a control is "owner" which returns a reference to the object that owns the control. If a control is on a tab page the owner is the page. You can then compare the owner reference to the Pages[] of the tab control. Lastly you just check the tab value.

Take a look at the attached VI. Although I am not sure anyone would call this a �simple� method.
0 Kudos
Message 4 of 8
(3,283 Views)
Thanks, that could really make it easier!

I really have to try that - could be very helpful

If I ask the result for its owner again and again I'll get a reference to the VI, won't I ?
What will I get if I ask the VI for its owner ?
0 Kudos
Message 5 of 8
(3,283 Views)
further question:

how can I detect that I have reached the top-level if I use this recursively inside a loop (I'm working with stacked TabControls!)
0 Kudos
Message 6 of 8
(3,283 Views)
The eventual owner will be the Front Panel. After that you will get an error which you could catch. Take a look at the attached VI.
0 Kudos
Message 7 of 8
(3,283 Views)
Thanks !!

I could solve my problem today by indexing each control and saving its "path" from front panel to its tabcontrol

Everything seems to work now

>> POSTING CLOSED :-)) <<
0 Kudos
Message 8 of 8
(3,283 Views)