Maintaining a forms aspect ratio ???

Jul 1 2008 11:33 AM

I’m in need of a little help.

I’m rather new to the C# Corner, in fact this is my first question I have posted here.

 

 I write code that controls automated machinery in factories. I have all my control code written and working, and am in the process of developing the user interface. Admittedly GUI’s  is probably what I am the weakest at, and normally they are done by another developer. Unfortunately, I have to do this project solo.  Since this is a control interface that displays a graphic of the parts being made I have to lock the aspect ratio of the main form. I have tried to do this several ways, but with less than desirable results. If I read the width, and then calculate the height and set it, I get a lot screen flicker, and it even locks up some of the time. I’ve tried to scale the form using SizeF, and even tried to over write the base core. But have not been successful in creating a satisfactory result.

 

For some reason I have the feeling that I can’t see the forest for all the trees, so this may be much easier than I am making it out to be. If anyone has any suggestions, I’m all ears at this point.

Thanks for any help you can offer

Todd


Answers (5)