Back to Devexpress

WizardControl.CustomizeCommandButtons Event

windowsforms-devexpress-dot-xtrawizard-dot-wizardcontrol-07c29838.md

latest4.2 KB
Original Source

WizardControl.CustomizeCommandButtons Event

Allows you to customize predefined buttons (Previous, Next, Cancel, Finish, and Help) and display/customize custom buttons.

Namespace : DevExpress.XtraWizard

Assembly : DevExpress.XtraWizard.v25.2.dll

NuGet Package : DevExpress.Win

Declaration

csharp
public event WizardCustomizeCommandButtonsEventHandler CustomizeCommandButtons
vb
Public Event CustomizeCommandButtons As WizardCustomizeCommandButtonsEventHandler

Event Data

The CustomizeCommandButtons event's data class is DevExpress.XtraWizard.CustomizeCommandButtonsEventArgs.

Remarks

The Wizard control raises the CustomizeCommandButtons event before a wizard page is displayed. Handle this event to customze the appearance, text, and visibility of command buttons.

The following example demonstrates how to display a custom button within the Registration Details page.

csharp
using System.Drawing;
using DevExpress.XtraWizard;

namespace DXApplication19 {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        WizardButton customButton;
        public Form1() {
            InitializeComponent();
            customButton = new WizardButton(wizardControl1) {
                Visible = false,
                TabIndex = 4,
                Text = "Advanced Settings"
            };
        }
        private void wizardControl1_CustomizeCommandButtons(object sender, DevExpress.XtraWizard.CustomizeCommandButtonsEventArgs e) {
            if(e.Page == wizardDetailsPage) {
                customButton.Location = new Point(10, e.PrevButton.Location.Y);
                customButton.Width += 50;
                customButton.Height = e.PrevButton.Size.Height;
                customButton.Visible = true;
            }
        }
    }
}
vb
Imports System.Drawing
Imports DevExpress.XtraWizard

Namespace DXApplication19
    Partial Public Class Form1
        Inherits DevExpress.XtraEditors.XtraForm

        Private customButton As WizardButton
        Public Sub New()
            InitializeComponent()
            customButton = New WizardButton(wizardControl1) With {
                .Visible = False,
                .TabIndex = 4,
                .Text = "Advanced Settings"
            }
        End Sub
        Private Sub wizardControl1_CustomizeCommandButtons(ByVal sender As Object, ByVal e As DevExpress.XtraWizard.CustomizeCommandButtonsEventArgs)
            If e.Page = wizardDetailsPage Then
                customButton.Location = New Point(10, e.PrevButton.Location.Y)
                customButton.Width += 50
                customButton.Height = e.PrevButton.Size.Height
                customButton.Visible = True
            End If
        End Sub
    End Class
End Namespace

Note

To hide the Back (Previous) button when the WizardControl is displayed in the Aero style (see WizardControl.WizardStyle), use the WizardControl.ShowBackButton property.

Read the following topic for information: Buttons.

See Also

Buttons

ShowBackButton

WizardControl Class

WizardControl Members

DevExpress.XtraWizard Namespace