07-01-2013 11:40 AM
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
Solved! Go to Solution.
07-01-2013 12:14 PM
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
07-01-2013 03:54 PM
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.
07-01-2013 04:09 PM
Actually not very hard. You'll have a panel size-event in which you can check current size and recenter the sub-panel.
/Y
07-02-2013 05:23 AM
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.
07-02-2013 06:09 AM
The nice simple command is a calculation based on bounds and sizes. 😉
/Y
07-04-2013 04:16 AM
Yeah I guess you are correct. It shouldnt be difficult to implement! Thanks for your help!