Page 1 of 1

how to close the window

Posted: 21 Sep 2006 17:47
by LOngFirE
hello im new at this stuff..and very interresting to learn.
a im trying to make a sort of program using:
borland delphi 2005: windows forms application:

and i made a 'main menu' and a 'Exit' button at the end of the file menu.
and i was wondering..what code must i use for making it close?
and where can i read about scripting?

one more thing: how can i connect a aboutbox to the about button i made on the menu?

thx for helping me...

Re: how to close the window

Posted: 16 Apr 2008 06:16
by Themasteratdelphi
the code to close a form in delphi is

[name_of_form].close;

to close an application there are two ways (1 more if using winAPI)

[name_of_main_form].close;

application.terminate;

hope this helps!

Re: how to close the window

Posted: 16 Apr 2008 06:21
by Themasteratdelphi
sorry dint read it all

about boxes can be created from a normal form (click 'new form' button in delphi, it will name it form2) you can drop the components on and do what you like to it.

to call it from an about menu you call

[about_box_name].show;

i am aware that a delphi wizard can automatically make an about box from the file > new > other > forms menu.

This about box is automatically placed in the program as unit 2, you can call the about box in the same way

aboutbox.show;

hope this helps too!

ps i recommend looking at http://www.delphi.about.com this site covers everything in delphi from the basics to opengl.