Tuesday, 15 November 2011
Home »
Tips and Trick Delphi
» Disable or Hide Close Button In Form Delphi
Disable or Hide Close Button In Form Delphi
To Share | Tuesday, 15 November 2011
Prevents the user to close the form by clicking the close button.
Function declaration:
NoCloser procedure (NamaForm: TForm);
var
hSisMenu, MCnt: integer;
begin
hSisMenu: = GetSystemMenu (NamaForm.Handle, False);
mCnt: = GetMenuItemCount (hSisMenu);
RemoveMenu (hSisMenu, mCnt - 1, MF_BYPOSITION Or MF_REMOVE);
DrawMenuBar (NamaForm.Handle);
end;
Use this function when the form OnCreate event or onShowContoh implementation:
TForm1.onCreate procedure (Sender: TObject);
begin
NoCloser (Form1);
end;
No comments:
Post a Comment