sanjeri
sanjeri

Reputation: 381

How to disable maximize button in delphi program?

How to disable maximize button in delphi program?

Upvotes: 11

Views: 12031

Answers (3)

Ugur
Ugur

Reputation: 1256

BorderIcons := BorderIcons - [biMaximize]

Upvotes: 1

jimsweb
jimsweb

Reputation: 1082

Here is another trick if you want to do it using code only.

procedure TForm1.FormCreate(Sender: TObject);
var
  l: DWORD;
begin

  // hide minimize and maximise buttons
  l := GetWindowLong(Self.Handle, GWL_STYLE);
  l := l and not(WS_MINIMIZEBOX);
  l := l and not(WS_MAXIMIZEBOX);
  l := SetWindowLong(Self.Handle, GWL_STYLE, l);

end;

Upvotes: 3

sanjeri
sanjeri

Reputation: 381

Oh! I found in object inspector "BorderIcons" Just set there biMaximize from true to false!

Upvotes: 27

Related Questions