This is a migrated thread and some comments may be shown as answers.

Add skip button to the RadWizard

3 Answers 310 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 22 May 2012, 10:04 AM
As part of a startup wizard I am developing, one of the requirements is to be able to skip any stage of the wizard. 

I have tried adding a button in between the Next and Cancel buttons as described in another thread but it does not seem to be working in my case.

public TestForm()
        {
            InitializeComponent();
 
            // add a skip button
            WizardCommandAreaButtonElement skipButton = new WizardCommandAreaButtonElement
            {
                Text = "Skip",
                MinSize = new Size(radWizard1.NextButton.Size.Width, radWizard1.NextButton.Size.Height),
                Alignment = ContentAlignment.MiddleRight,
                Margin = new Padding(4, 0, 4, 0)
            };
 
            radWizard1.CommandArea.CommandElements.Add(skipButton);           
        }

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 25 May 2012, 06:45 AM
Hello Adam,

Thank you for writing.

There are two things that you need to do in order to have a fully functioning WizardCommandAreaButtonElement. First, you should move the creating code in the Shown event of the Form, since in the constructor the size of the NextButton is not yet calculated. Second, you should set the Class property of the button, so it will know which theme to use. For example, here is how apply the same theme settings as in NextButton:

protected override void OnShown(EventArgs e)
{
    base.OnShown(e);
 
    // add a skip button
    WizardCommandAreaButtonElement skipButton = new WizardCommandAreaButtonElement
    {
        Text = "Skip",
        Class = "NextButton",
        MinSize = new Size(radWizard1.NextButton.Size.Width, radWizard1.NextButton.Size.Height),
        Alignment = ContentAlignment.MiddleRight,
        Margin = new Padding(4, 0, 4, 0)
    };
    radWizard1.CommandArea.CommandElements.Add(skipButton);  
 
}

Using the same approach, you can set the class to "CancelButton", "FinishButton" or "HelpButton", and your new button will take their theme settings. Alternatively, you can use RadButtonElement, instead of WizardCommandAreaButtonElement and in this case, the button will take the default button theme settings.

Off topic, I noticed that your subscription has expired, which means that your support package has exipred as well. Note that you will need to renew your subscription in order to continue to receive support from us. To do this, please contact sales@telerik.com or check your account (www.telerik.com/account.aspx). 

I hope that you find this information useful.

Greetings,
Stefan
the Telerik team
 
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
 
0
Adam
Top achievements
Rank 1
answered on 25 May 2012, 10:41 AM
This code works but only on version 2011 Q3 of the controls (I had previously downloaded a trial version to test if a particular feature was fixed) (we are using 2011 Q1). After discussions it has been decided to not include this functionality as a controls upgrade requires test runs on our full software suite (5 products)

Thank you for your assistance.
0
Boryana
Telerik team
answered on 30 May 2012, 10:02 AM
Hi Adam,

Thank you for writing back.

Feel free to contact us if you encounter any issues or difficulties during the upgrade, once you decide to initiate the process. We will do our best to assist you.

Kind regards,
Boryana
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
Wizard
Asked by
Adam
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Adam
Top achievements
Rank 1
Boryana
Telerik team
Share this question
or