开发者

How to disable maximize button in delphi program?

开发者 https://www.devze.com 2022-12-21 11:20 出处:网络
How 开发者_开发问答to disable maximize button in delphi program?Oh! I found in object inspector \"BorderIcons\"

How 开发者_开发问答to disable maximize button in delphi program?


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


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;


BorderIcons := BorderIcons - [biMaximize]

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号