Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling the form maximize function

Status
Not open for further replies.

CHeighlund

Programmer
Jun 11, 2007
163
US
Is there a specific way to disable a form's ability to be maximized, either from the 'maximize' button or the windows (Maximize) listing in the popup bar for a minimized window? One form I'm working with has a lot of stuff in one section, but requires a few components (mostly panels, although there's a memo field as well) that are set to some resizeable alignment (alTop, alBottom, alClient) on the screen. This leaves a lot of blank space when the form is maximized, and I'm hoping to prevent the user from having to see that. Anyone have any suggestions as to where I should begin?
 
Yes, in form property BorderIcons. Set biMaximize to false.

Roo
Delphi Rules!
 
Depending on the Windows version (I don't know about Vista) that will also kill your minimize button.

If that is a problem, then you can write yourself a WM_SYSCOMMAND message handler that ignores wParam = SC_MAXIMIZE.

Hope this helps.
 
See thread102-1472745, which will have code to answer your question.

----------
Measurement is not management.
 
Duoas - Just an FYI, tested with BorderStyle:= bsNone and BorderIcons.biMaximize:= false did not kill my minimize button running XP SP3.

BorderStyle appears to have a huge impact on button behavior.


Roo
Delphi Rules!
 
Ack, my brain was working backwards... Just disabling the maximize should leave the button there, you just can't use it.

But exactly as Roo said, the BorderStyle has a direct impact on what kinds of buttons you can have there (without drawing them yourself).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top