Aspect ratio
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts
Page 1 of 1
Hello,
I want to resize my windows form, but it must keep the aspect ratio 16:9.
How can I do this?
Greetings,
gille
I want to resize my windows form, but it must keep the aspect ratio 16:9.
How can I do this?
Greetings,
gille
Well, the way I'd do it, would be to use the calculator and then multiply/divide both the numbers with a constant. For example, if I want to get the ratio of an A4 size paper in paint then I'd multiply the dimensions by 2 or 3 (210*297).
Code: Select all
I can't test it now since I'm on my iPod. When I get to my PC I can also give a better example.Dim ratio As Double = 16 / 9
'To get the width: Width = ratio * Height'
'To get the Height: Height = Width / ratio'
Last edited by MrAksel on Tue Jun 12, 2012 12:21 pm, edited 1 time in total.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

Your code will be:
+REP if helped.
Code: Select all
Or better way. Private Sub Form1_Resize(sender As System.Object, e As System.EventArgs) Handles MyBase.Resize
Me.Width = Me.Height * 1.77
End Sub
+REP if helped.
My code is the same as yours, you just calculated the 16/9 value
The better way was I had in mind too, I just forgot to update my answer :lol: Great that you posted it

LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

5 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023