Private Sub FrmLabelCheck_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[color=green] '' การเรียกใช้งาน
Call QVGAtoVGA(Me)
End Sub
Public Sub QVGAtoVGA(ByVal top As System.Windows.Forms.Form)
For Each item As Control In top.Controls
'// left/top/width/height
item.Left = item.Left * ratio
item.Top = item.Top * ratio
item.Width = item.Width * ratio
item.Height = item.Height * ratio
'// font size
If item.GetType.Name <> "PictureBox" Then
item.Font = New Font(item.Font.Name, item.Font.Size * ratio, item.Font.Style)
End If
Next
'// Adjust form size
top.Left = top.Left * ratio
top.Top = top.Top * ratio
top.Width = top.Width * ratio
top.Height = top.Height * ratio
top.Font = New Font(top.Font.Name, top.Font.Size * ratio, top.Font.Style)
top.WindowState = FormWindowState.Maximized
End Sub