i have a picbox that i use to draw a graph. dock is set to fill so it will consume the entire graph. but, the graph is scaled and becomes stretched when the user resizes one border of the form. i want the form to always be a square shape, so the height and width are always the same.
i use this code right now, but it gives me a nice little infinite loop:
VB Code:
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize If Me.Width > Me.Height Then Me.Height = Me.Width Else Me.Width = Me.Height End If End Sub
any suggestions?




Reply With Quote