StrataFrame Forum

How do I add command button to wizard control

http://forum.strataframe.net/Topic32564.aspx

By Danny Doobay - 5/9/2014

Hello,

Wizard control comes with standard buttons like Help, Back, Next, Cancel and Finish. We would like to add couple more buttons to it and have method for them.

How do you do that?

tks
By StrataFrame Team - 5/9/2014

You can change the text of the buttons to be anything you want, so if you don't need all of the buttons (like "Help", which is seldom used), you can take them over by changing the text and using the built-in handlers of the WizardControl.  Other than that, you can simply put a button on top of the wizard control.  It will belong to the page, but it will get rendered in the right place.
By Danny Doobay - 5/13/2014

We are using the help button. We want to add two more buttons but simply dropping a button on the surface on the wizard control is not working. 

Button is there on design time but on run time it is not displayed.

Anyone knows why?
By StrataFrame Team - 5/13/2014

The problem is that the button has been added to the controls collection of the WizardControl instead of the Form.  You need to shrink the WizardControl so that you can see some of the Form and then drag the button to the Form or edit the InitializeComponent() method and change the

this.wizardControl1.Controls.Add(this.button1);

to this

this.Controls.Add(this.button1);

After you do that, you can change z-order of the button (bring to front) if necessary to get it on top of the wizard control.  You'll notice though, that the button has a little border around it that doesn't match the other buttons, that's because it belongs to the form, not the wizard control, so it's letting the forms back color show through.  You can fix this one of two ways: 1) add a panel that matches the back color of the footer of the WizardControl, make sure it's in the Form's Controls collection, and add your extra buttons to it or 2) change the back color of the Form to match the footer of the WizardControl.  The first option is probably best, because the second option will bleed through to all of the other controls that are marked as transparent, not just the button at the bottom.
By Danny Doobay - 5/15/2014

It worked. Tks.