LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Position Tab Control In Centre of Screen

Solved!
Go to solution

Is there a way to position a tab control so that it is always in the centre of the screen (even if the user changes the window size)?

 

I have tried using the panel size properties to determine the centre and then use the tab control's position reference. But it seems to me that the control's position is relative to its starting position(??).

 

Is there a way to poisiton it relative to the panel's origin?

 

Thanks in advance.

 

ssk

0 Kudos
Message 1 of 6
(4,397 Views)

If you don't mind it resizing, you can right-click the tab control and select "Scale Object with Pane".

 

If you need it to remain constant width and height, then you're on the right track with property nodes. You should be able to query the front panel size for each resize event, and with a little bit of mathematics use that information to determine new position coordinates for the tab such that its centre remains in the middle.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 2 of 6
(4,395 Views)

If I wire some constants to the position property for my tab control I would expect it to always be in the same position.

 

If I move the scrollbar so that the tab control is just off screen then when I run it does not pull it by to the previous positio. I think I need to tie it to the origina of the window. I have tried to do this using the Pane_Origin property as a reference but when I run it still seems to position the tab control elsewhere.

 

I thought this would be straightforward!!

0 Kudos
Message 3 of 6
(4,381 Views)
Solution
Accepted by topic author ssk

It is straightforward. Unless I've misunderstood you, isn't this what you need?

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 4 of 6
(4,375 Views)

I was making things too complicated as usual!

 

Thanks

Message 5 of 6
(4,357 Views)

 

 

Just what I needed  thanks.

 

 

JCollado
0 Kudos
Message 6 of 6
(3,865 Views)