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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie: example on report dialog 1

Status
Not open for further replies.

Euphaz

Programmer
Jul 12, 2001
40
NO
I am writing a program until now using a single form and some messagedialogs. Now i would like to create a report that pops up in a new window with 3-4 buttons and memo/string grid.

The buttons in the report are supposed to start one or more processes like printing report, or close the report window. But when selecting a process, the report window must not close. Thats a 'problem' with MessageDlg.

What kind of form object are sutable, and what kind of properties? There are som amy to choose from! An example would be great!
 
File | New Form. Drop some components on it -- your three buttons etc. Label one button OK, set its ModalResult to mrOk; if appropriate label another Cancel, ModalResult similarly. No code is needed to make these buttons work.

To show your new form, somewhere in Form1's code, add
Code:
Form2.Show
, or
Code:
Form2.ShowModal
. (See help for details.) If you need to set stuff up in Form2 before it's shown, you can do so with code like
Code:
Form2.Button1.Caption := 'Hello';
, etc.

Note that this new form will be created when your app is created, and destroyed when your app is destroyed, and will therefore consume memory all this time. For more, see Project | Options | Forms | Help, and help on TForm.Create, and TForm.Release. -- Doug Burbidge mailto:dougburbidge@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top