2014年3月18日 星期二

Resizing Window Form control

參考引用來源
--
Private Sub Test_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim widthRatio As Single = Me.Size.Width / 300.0F
    Dim heightRatio As Single = Me.Size.Height / 300.0F
    Dim scale As New SizeF(widthRatio, heightRatio)
    Me.Scale(scale)
    For Each control As Control In Me.Controls
        control.Scale(scale)
        control.Font = New Font(control.Font.FontFamily,   control.Font.SizeInPoints * widthRatio * heightRatio)
    Next
End Sub

沒有留言:

張貼留言