Add skip button to the RadWizard

4 posts, 0 answers
  1. Adam
    Adam avatar
    10 posts
    Member since:
    Nov 2010

    Posted 22 May 2012 Link to this post

    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);           
            }
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 25 May 2012 Link to this post

    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 >>
     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Adam
    Adam avatar
    10 posts
    Member since:
    Nov 2010

    Posted 25 May 2012 Link to this post

    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.
  5. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 30 May 2012 Link to this post

    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 >>
Back to Top