Practical
Learning: Creating a Wizard
|
|
- To start a new project, on the main menu, click File -> New -> VCL
Forms Application - C++Builder
- From the Standard section of the Tool Palette, double-click the
Panel control.
- Set the following properties for the panel (leave the other
properties intact):
BevelOuter: bvNone Caption:
Delete Height: 265 Left: 0 Name: pnlFirstPage Top: 0
Width: 430
- From the Tool Palette, click the TEdit control
and click anywhere on the panel. This is a simple control that will
serve as an indication when we are in the first page
- Click the panel on the form to make sure it is selected
- On the main menu, click Edit -> Copy
- Click an empty area on the form to deselect the panel and select the
form
- On the main menu, click Edit -> Paste
- With the new pasted panel still selected, change its properties as
follows:
Left: 0 Name: pnlSecondPage Top: 0
- From the Tool Palette, click the ScrollBox control and click on the
panel.
- Click an empty area on the form to select the form
- From the main menu, click Edit -> Paste
- For the newly pasted panel, change the properties as follows:
Left: 0 Name: pnlThirdPage Top: 0
- On the Tool Palette, click the TGroupBox control
and click on the current panel
- On the Tool Palette, click the Additional tab
- Click the TBevel control
- Click an unoccupied area in the lower section of the form
- Change the properties of the Bevel control as follows:
Height:
25 Left: 0 Shape: bsTopLine Top: 272 Width: 430
- On the Tool Palette, click the Standard section
- Click the TButton control
- Click in the lower section of the form
- Change the properties of the button as follows:
Caption: &Back
Left: 112 Name: btnBack Top: 280
- Add another button on the right side of the Back button and change
its name to btnNext
- Add another button of the right side of the Next button and change
its name to btnFinish
- Add one more button on the right side of the finish button. Set its
Cancel property to true and its name to btnCancel
When a wizard starts, the user is presented with the
first page. After using it, he or she can click Next to move to the
subsequent page. The user can continue clicking Next to complete the
necessary task(s) on each page. At any time and except on the first page,
the user can click the Back button to move backward.
Most wizards
have a Cancel button that would allow the user to dismiss the dialog box. In
this case, whatever change the user would have performed on the controls
hosted by the wizard would be discarded.
Many wizards are also
equipped with a Finish button. There are two scenarios in which the Finish
button can be used:
|
|