ProblemYou want the user to be able to resize a form, but within limits. SolutionUse the MinimumSize and MaximumSize properties of the form to limit the user's adjustments of the form's size. As with the standard Size property, these two properties encapsulate separate width and height values. Figure 4-16 shows these settings in use in the Properties panel. Figure 4-16. MaximumSize and MinimumSize properties in useDiscussionThese properties do limit the size of the form, whether the user is resizing the form directly or your code sets the Size property. You will usually want to set the form's FormBorderStyle property to Sizable, and you must set the MaximizeBox property to False (or in some other way hide the maximize box, such as by setting the ControlBox property to False). |