LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Maximize a panel maintaining the correct aspect ratio

Hello everyone,

how can I maximize a panel maintaining the correct aspect ratio?

 

Thanks  

0 Kudos
Message 1 of 6
(3,667 Views)

you might combine GetPanelAttribute (, ATTR_HEIGHT, ) and GetPanelAttribute (, ATTR_WIDTH, ); with SetPanelSize (, , );

Message 2 of 6
(3,659 Views)

Hi,

this can't be done automatically, since when you enable panel sdjust on rescaling and maximize it it will scale each dimension independent from the other. That is, a panel developed for a 4:3 resolution will appear stretched if maximized on a 16:9 screen.

 

If you have only a few controls on the panel you could disable automatic rescaling and add an horizontal and vertical hidden splitter attaching all controls to them. When you want to maximize the panel you will need to calculate the necessary adjustment on each dimension and move the splitters accordingly with OperateSplitter so that they resize the controls. Next you can maximize the panel.

 

In case you have a lot of controls attaching all them to the splitters can be a hassle; in this case you can enable resolution adjustment, change panel sizes calculating the maximum dimensions that respect aspect ratio, next disable resolution adjustment and finally maximize the panel.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 6
(3,656 Views)

Thanks a lot guys !!! 

0 Kudos
Message 4 of 6
(3,648 Views)

Hi to all!

 

Roberto always gives excellent solutions. Let me share with you an additional document concerning a similar issue. I hope it could help in future:

 

How to Programmatically Maximize or Minimize your CVI Panel

 

Have a great day!

Best regards

Matteo
0 Kudos
Message 5 of 6
(3,637 Views)

Let's hope nobody is using DOS compatibility windows anymore... Smiley Wink

0 Kudos
Message 6 of 6
(3,632 Views)