02-14-2009 10:42 AM
Hi,
I need my VI to run on different screen resolutions.
But the problem is that when the resolution changes the controls get distorted and i have to restart the applicaiton to bring the screen to origional form.
I need to resize the controls according to the window size so i have checked the option to "scale objects while resizing".
I think this is why the controls get distorted besause of resizing.
Is there any solution if want to keep both options for resizing and adjusting the screen for different resolutions.
Regards
Gagan
02-16-2009 08:21 AM
When you resize a VI automatically, the original size is not cached, thus changes are permanent. If you resize again, the changes start from the changed values, not the original values. Factor in the some integer roundoff issues and you have your problem. In addition, different versions of LabVIEW have varying degrees of distortion as you change the screen size and system controls have limits on how they can change their size. The only way to guarantee nice looking, scaleable panels is to do it all yourself programmatically (change location, size, and font sizes). This is tedious, but straightforward, and you should only have to do it once. It is made more difficult by the fact that there is no standard way to change the size of a control. Use the event structure to determine when your panel has been resized. Use the Defer Panel Updates property to speed the process. In addition, you probably want to throttle the events so you don't get behind in processing them. The easiest way to do this is to compare the new size reported by the Panel Resize event with the value from a property node which reads the panel size. If they are equal, process the event. If they are not, do nothing. The last event will always be processed because the sizes will be the same.
Good luck! Let us know if you run into difficulties.