shadowrecon Posted January 20, 2012 Share Posted January 20, 2012 How or where should i add a onclose event as it effects the whole form and there is no button made for the 'x' at the top. so would it be like Formname.onclose := @dosomething; and just put it anywhere? Quote Link to comment Share on other sites More sharing options...
FHannes Posted January 20, 2012 Share Posted January 20, 2012 I'm not sure I understand what you're asking, you should assign the OnClose event in the InitForm procedure... Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted January 20, 2012 Share Posted January 20, 2012 You're looking for something like this? procedure FormOnClose(Sender: TObject; var CloseAction: TCloseAction); begin // Do something here. end; procedure InitForm begin // Some code here Form.OnClose := @FormOnClose; end; Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted January 20, 2012 Author Share Posted January 20, 2012 You're looking for something like this? procedure FormOnClose(Sender: TObject; var CloseAction: TCloseAction); begin // Do something here. end; procedure InitForm begin // Some code here Form.OnClose := @FormOnClose; end; That is what i was looking for thanks! Quote Link to comment Share on other sites More sharing options...