
Untitled
By: a guest on
Apr 26th, 2010 | syntax:
VB.NET | size: 0.65 KB | hits: 117 | expires: Never
Public Class Form1
Private Sub Form1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
Dim myControl As Control
myControl = sender
' Ensure the Form remains square (Height = Width).
If myControl.Size.Height <> myControl.Size.Width Then
myControl.Size = New Size(myControl.Size.Width, myControl.Size.Width)
End If
If myControl.Size.Height < 320 Then
myControl.Size = New Size(319, 319)
End If
If myControl.Size.Width < 320 Then
myControl.Size = New Size(319, 319)
End If
End Sub
End Class