Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i disable window-closing? 1

Status
Not open for further replies.

sancho1980

Technical User
Nov 25, 2005
15
DE
If I have a TForm object, it by default closes when I click on the X of the window, right? There must be a way of disabling that, is there? I was looking like mad for an appropriate property but wasn't able to find it...
Thanx,
Martin
 
The appropriate "property" is the OnClose event.

The following ignores any clicking on the X.
Code:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  action := caNone;
end;

Andrew
Hampshire, UK
 
There's also the biSystemMenu property under BorderIcons in the object inspector if you don't want the button at all, but towerbase's way lets you choose.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top