Fog Creek Software
Discussion Board

Also with wizards

I forgot to mention this last time. What would be the proper way to write wizards: Separate forms and a controller class (I've done this before in VB) or one form with a PageControl (I'm trying this right now but haven't been able to write validation code -- OnChanging only executes when the user clicks a tab).

By the way thans for the answer last time.

Julio César Carrascal Urquijo
Wednesday, November 27, 2002

We use TPageControl for wizards. You can place your validation code in the NextButton.OnClick event or in the OnChanging event of the TPageControl.

The Delphi Fan
Thursday, November 28, 2002

I use a pagecontrol with hidden tabs and do the validation checks when the Previous/Next buttons are clicked. That way you don't need the pagecontrol onchange events.

If you hide the tabs at run time you can still use them during design time to easily browse the tabs.

Jan Derk
Friday, November 29, 2002

Depending on the complexity of the wizard and how many developers are on the project, I use:

For simple wizards: A TPageControl, as mentioned above. Make sure you set the PageControl's TabStop property to False, or you get ghosted tab stops.

For complex wizards: A form that contains a custom TFrame. At wizard start I create all the TFrames then display the correct one as the user moves through the wizard.  The benefit of this is that multiple people can be working on different wizard pages without conflicting with each other.

Tim Sullivan
Saturday, November 30, 2002

A better component for this job is TNotebook. This is hidden away in the "Win3.1" tab, but there's nothing wrong with it. It has *no* graphical elements at all and therefore is simpler.

Aaron Lawrence
Thursday, December 5, 2002

*  Recent Topics

*  Fog Creek Home