We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Form Minimum and Maximum Size Properties

Is there a known issue with the Minimum and Maximum size properties of the windows form? I have MDI Child forms with the FormBorderStyle set to Sizable and Minimum sizes established. The form will not resize smaller than the Minimum size in the designer but the Minimum and Maximum sizes do not seem to be recognized at run time. Any thoughts/work arounds? Anthony Mansfield Development Xfactor

1 Reply

AM Anthony Mansfield July 2, 2002 07:40 PM UTC

I should learn have learned my lesson by now. If you have a challenge, check the Windows Forms FAQ first! I found a C# example that I converted into VB.NET. The guys maintaining that FAQ get serious kudos for providing an awesome reference. Here is the VB version: Private Sub frmTestFind_Layout(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LayoutEventArgs) Handles MyBase.Layout If (Me.Bounds.Width < Me.MinimumSize.Width) Then Me.Size = New Size(Me.MinimumSize.Width, Me.Size.Height) End If If (Me.Bounds.Height < Me.MinimumSize.Height) Then Me.Size = New Size(Me.Size.Width, Me.MinimumSize.Height) End If End Sub Anthony Mansfield Development Xfactor

Live Chat Icon For mobile
Up arrow icon