Resizing and maximizing shape

I forbid resizing the form. How do I remove the maximize button?

+1


source to share


3 answers


If it is the winforms (.net) you are talking about, right click on the form in the designer and select properties. Make sure "MaximizeBox" is disabled in the property list.



If it's MFC then find the "Control Box" property and disable it.

+2


source


First of all ... to be able to resize (or not) the FormBorderStyle must be set to the correct value. To not allow resizing, select one of the options that does not say "Resizable".

Then, to remove the control buttons in the upper right corner, set the "MaximizeBox" or "MinimizeBox" value to false. You can clear all top buttons by setting "ControlBox" to false.



These are all properties of the Form itself. I'm not sure about the exact name of the properties ...

Hope this helps :)

+2


source


You are probably talking about .NET, but if not, and you are using the windows API, you must specify this when you call CreateWindow. something like that:

hwnd = CreateWindow (szAppName, TEXT("Program Name"),
    WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
    ...

      

should give you a window that cannot be resized. Be specific when you call a method, not pass something like WS_OVERLAPPEDWINDOW.

0


source







All Articles