Source Code



Disable Close button on form caption

  • anonymous
  • Jan 10' 14
  • Delphi
  • 193
  • 182
  • United States
//See this example. For enabling button use MF_ENABLED instead of MF_GRAYED.



procedure TForm1.Button1Click(Sender: TObject); var Flag: UINT; AppSysMenu: THandle; begin AppSysMenu:=GetSystemMenu(Handle,False); Flag:=MF_GRAYED; EnableMenuItem(AppSysMenu,SC_CLOSE,MF_BYCOMMAND or Flag); end;
  • Tags : disable, close, button
comments powered by Disqus

Related Code

Access the controls of a TRadioGroup

Disable Keyboard and Mouse



Category

Tag Linked