Windows Forms Fixed Ratio

Does anybody know how to fix the aspect ratio of a windows forms application?
There is no automatic way to do it, but it can be done manually.
Create an event hand for the resize event in the properties inspector.
The code should look like sth. this:
1
2
3
4
System::Void MyForm_Resize(System::Object^  sender, System::EventArgs^  e) 
 {

 }

Add some code to resize to form according to your ratio - like so.
1
2
3
4
5
6
7
8
System::Void MyForm_Resize(System::Object^  sender, System::EventArgs^  e) 
 {
   MyForm^ form = (MyForm^) sender;
   // TO DO
   // Check the form height and width and adjust if neccessary
   // for example
   // form->Width = form->Height * 2;
 }
Topic archived. No new replies allowed.