How to disable maximize button in delphi program?
Asked
Active
Viewed 1.2k times
3 Answers
27
Oh! I found in object inspector "BorderIcons" Just set there biMaximize from true to false!

sanjeri
- 381
- 1
- 3
- 6
-
You are a genius! – Soon Santos Dec 31 '18 at 12:46
3
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;

jimsweb
- 1,082
- 2
- 17
- 37
-
8In VCL code this should simply be `BorderIcons := BorderIcons - [biMaximize]`. – Uli Gerhardt Feb 24 '12 at 08:00