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.
Unfortunately, activation email could not send to your email. Please try again.

Form Minimum and Maximum Size Properties

Thread ID:





512 Jul 2,2002 03:14 PM Jul 2,2002 03:40 PM Windows Forms 1
Tags: FAQ
Anthony Mansfield
Asked On July 2, 2002 03:14 PM

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

Anthony Mansfield
Replied On July 2, 2002 03:40 PM

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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.