LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent SubVI resizing in a Sub Panel

Solved!
Go to solution

I have made a Sub VI, which I have designed to remain fixed size. It works great standalone, but as soon as I put it in a subpanel it resizes itself and all the controls which are out of the normal window bounds get shown.

 

I have specified the minimum panel size which is smaller than the Sub Panel, I have tried all different window appearances, as for Window Run-Time Position I have kept that as centered.

 

What I would like happening is for the Sub Panel to be scalable, but the Sub VI that it shows to remain fixed size and in the center of it as it should always be smaller than the Sub Panel. It this possible to achieve if yes, I would really appreciate it if someone could tell me how to do it.

 

I am using Labview 2009, don't know if this has been corrected in later versions.

 

Regards

 

Kewal

0 Kudos
Message 1 of 7
(3,945 Views)

An inserted sub-panel uses the sub-panel size. You could probably change the Bounds-property of ths sub-panel to change it's size, but i simply fix it by hiding unwanted controls or making a tab-control and placing unwanted stuff there. It can also be made with invisible tabs and borders, should it be needed.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 7
(3,935 Views)

I see! Thanks for your suggestions. Unfortunately neither of the two suggestion would allow for the Sub VI to be central if the top level window was resized which is what I was hoping for by keeping the Window Run Time Position as centered.

 

The only way I can imagine doing that is by keeping the bounds for the Sub Panel the same size as the Sub VI window and then programmatically moving the Sub Panel on resize so as to keep it centered. This seems quite a complicated solution.

0 Kudos
Message 3 of 7
(3,918 Views)

Actually not very hard. You'll have a panel size-event in which you can check current size and recenter the sub-panel.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 7
(3,916 Views)

Is there actually a nice simple command to recenter the sub panel or do I need to do that programmatically by calculating the bounds and window sizes?

 

I guess I am less concerned about resizing of the window when running just that the top level VI this subpanel is in would load maximised on various different resolution monitors and I would like the Sub VI to appear centered.

0 Kudos
Message 5 of 7
(3,905 Views)
Solution
Accepted by topic author kewsvnet

The nice simple command is a calculation based on bounds and sizes. 😉

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 6 of 7
(3,897 Views)

Yeah I guess you are correct. It shouldnt be difficult to implement! Thanks for your help!

0 Kudos
Message 7 of 7
(3,876 Views)