Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 26th, 2010  |  syntax: VB.NET  |  size: 0.65 KB  |  hits: 117  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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