Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I specify that a VB6 form is not resizable?

Tags:

vb6

How do I prevent the user from resizing form dialogues in VB6? The dialogues are small and simple and resizing them serves no purpose, so I'd prefer to prevent it than write code to handle it.

like image 844
Brian Hooper Avatar asked Nov 12 '10 11:11

Brian Hooper


People also ask

How do I stop a form from being resized?

Answers. FormBorderStyle = FormBorderStyle. FixedSingle will prevent users from manually resizing the form. To prevent the form from being resized through code, handle the SizeChanged event and set the size back to the fixed size you want it to be.

How to lock form size in vb net?

In the Properties window of Visual Studio, select the Locked property and then select true. (Double-clicking the name toggles the property setting.) Alternatively, right-click the control and choose Lock Controls. Locking controls prevents them from being dragged to a new size or location on the design surface.

How do I make winform not resizable?

Resizing of the form can be disabled by setting the FormBorderStyle property of the form to FixedDialog , FixedSingle , or Fixed3D .

How do you make a form resizable in C#?

Creating our Resizable FormOpen Visual Studio and select "Windows Forms Application" from the list of available templates and name it "DynamicallyPositioningControls". Rename your form to "frmDynamicResizing" by setting its Name property and sets its Text property to "Dynamic Resizing Form".


1 Answers

You can set the BorderStyle of the form to either "Fixed Single" (vbFixedSingle) or "Fixed Dialog" (vbFixedDouble) at design-time. Either of these will prevent the user from resizing the form.

Fixed Single provides a Control-menu box, title bar, Maximize button, and Minimize button. The form will still be resizable using the Maximize and Minimize buttons, but not by dragging the edges of the window.

Fixed Dialog provides a Control-menu box and title bar, but eliminates the Maximize and Minimize buttons. It is therefore not resizable at all. (Also note that a form that contains a menu cannot be displayed as a Fixed Dialog and is automatically changed to the Fixed Single border style.)

See also the relevant MSDN entry: http://msdn.microsoft.com/en-us/library/aa245047(VS.60).aspx

like image 105
Cody Gray Avatar answered Oct 03 '22 21:10

Cody Gray