Strange, on my machine it doesn't infinitely loop (although it looks to me like it ought to). Why don't you try:
VB Code:
Private Sub Form1_Resize(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles MyBase.Resize If Me.Width <> Me.Height Then If Me.Width > Me.Height Then Me.Height = Me.Width Else Me.Width = Me.Height End If End If End Sub
This should reduce the number of times the event fires (avoid adjusting width/height if they are already equal)




Reply With Quote