Hi,
How can I have a Control change its size in
proportion to the screen?
Thank you
Printable View
Hi,
How can I have a Control change its size in
proportion to the screen?
Thank you
Here is a way. Take down the measurements of your controls and your form in designing. For example:
With frmMyForm
.Height = 8400
.Width = 12800
End With
With cmdMyButton
.Height = 400
.Width = 655
End With
Then put the following code in your form:
Code:
--------------------------------------------------------
Private Sub Form_Resize()
With cmdMyButton
.Height = Me.ScaleHeight/8400*400
.Width = Me.ScaleWidth/12800*655
End With
End Sub
--------------------------------------------------------
Hope it helps.
Thank you xmin.
See the following links.
http://www.vb-world.net/articles/resizeocx/
http://www.vb-world.net/tips/tip489.html