Guest
Private paste!

Untitled

By: a guest | Apr 26th, 2010 | Syntax: VB.NET | Size: 0.65 KB | Hits: 111 | Expires: Never
Copy text to clipboard
  1. Public Class Form1
  2.  
  3.     Private Sub Form1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
  4.         Dim myControl As Control
  5.         myControl = sender
  6.  
  7.         ' Ensure the Form remains square (Height = Width).
  8.         If myControl.Size.Height <> myControl.Size.Width Then
  9.             myControl.Size = New Size(myControl.Size.Width, myControl.Size.Width)
  10.         End If
  11.         If myControl.Size.Height < 320 Then
  12.             myControl.Size = New Size(319, 319)
  13.         End If
  14.         If myControl.Size.Width < 320 Then
  15.             myControl.Size = New Size(319, 319)
  16.         End If
  17.     End Sub
  18.  
  19. End Class