Private Sub pg_Resize(Width As Int, Height As Int)
Dim Ratio As Double
Ratio = Width / Height
Dim dimensionBut As Int
Dim wBut As Int
Dim hBut As Int
If Width <= Height Then
dimensionBut = Width / 3
wBut = dimensionBut * Ratio
hBut = dimensionBut * Ratio
Else
dimensionBut = Height / 3
hBut = dimensionBut / Ratio
wBut = dimensionBut / Ratio
End If
Dim Left1 As Int = (Width - (2 * wBut)) / 2
Dim Left2 As Int = (Width - (3 * wBut)) / 2
Dim Top1 As Int = (Height - (3 * hBut)) / 2
Buton1.Left = Left1
Buton1.Top = Top1
Buton1.Width = wBut
Buton1.Height = hBut
Buton2.Left = Left1 + wBut
Buton2.Top = Top1
Buton2.Width = wBut
Buton2.Height = hBut
Buton3.Left = Left2
Buton3.Top = Top1 + hBut
Buton3.Width = wBut
Buton3.Height = hBut
Buton4.Left = Left2 + wBut
Buton4.Top = Top1 + hBut
Buton4.Width = wBut
Buton4.Height = hBut
Buton5.Left = Left2 + 2 * wBut
Buton5.Top = Top1 + hBut
Buton5.Width = wBut
Buton5.Height = hBut
Buton6.Left = Left1
Buton6.Top = Top1 + (2 * hBut)
Buton6.Width = wBut
Buton6.Height = hBut
Buton7.Left = Left1 + wBut
Buton7.Top = Top1 + (2 * hBut)
Buton7.Width = wBut
Buton7.Height = hBut
.....