Testing the Component

From RAD Studio
Jump to: navigation, search

Go Up to Making a dialog box a component Index

Once you have installed the dialog box component, you can use it as you would any of the common dialog boxes, by placing one on a form and executing it. A quick way to test the About box is to add a command button to a form and execute the dialog box when the user clicks the button.

For example, if you created an About dialog box, made it a component, and added it to the Tool palette, you can test it with the following steps:

  1. Create a new project.
  2. Place an About box component on the main form.
  3. Place a command button on the form.
  4. Double-click the command button to create an empty click-event handler.
  5. In the click-event handler, type the following line of code:
 AboutBoxDlg1.Execute; AboutBoxDlg1->Execute();
  1. Run the application.

When the main form appears, click the command button. The About box appears with the default project icon and the name Project1. Choose OK to close the dialog box.

You can further test the component by setting the various properties of the About box component and again running the application.