Loading...
Loading...
Guide for implementing Syncfusion WizardControl component in Windows Forms applications. Use when creating multi-step forms, installation wizards, setup dialogs, or step-by-step workflow interfaces with navigation buttons. Covers assembly deployment, page management, banner configuration, validation, navigation button handling, events, and appearance customization for professional wizard interfaces.
npx skill4agent add syncfusion/winforms-ui-components-skills syncfusion-winforms-wizard-controlSyncfusion.Tools.Windows.dllSyncfusion.Windows.Forms.Toolsusing System;
using System.Drawing;
using System.Windows.Forms;
using Syncfusion.Windows.Forms.Tools;
public partial class InstallationWizard : Form
{
private WizardControl wizardControl1;
private WizardControlPage welcomePage;
private WizardControlPage licensePage;
private WizardControlPage installPage;
private WizardControlPage finishPage;
public InstallationWizard()
{
InitializeComponent();
CreateWizard();
}
private void CreateWizard()
{
// Create wizard control
wizardControl1 = new WizardControl
{
Dock = DockStyle.Fill,
Style = Syncfusion.Windows.Forms.Tools.Wizard.Style.Metro
};
// Create pages
welcomePage = new WizardControlPage
{
Title = "Welcome",
Description = "Welcome to the Installation Wizard",
BackVisible = false // Hide Back on first page
};
licensePage = new WizardControlPage
{
Title = "License Agreement",
Description = "Please read and accept the license terms"
};
installPage = new WizardControlPage
{
Title = "Installing",
Description = "Please wait while files are being installed"
};
finishPage = new WizardControlPage
{
Title = "Completed",
Description = "Installation completed successfully",
NextVisible = false,
CancelVisible = false,
FinishVisible = true
};
// Add pages to wizard
wizardControl1.WizardPages = new WizardControlPage[]
{
welcomePage,
licensePage,
installPage,
finishPage
};
// Add wizard to form
this.Controls.Add(wizardControl1);
this.Text = "Setup Wizard";
this.Size = new Size(600, 450);
}
}Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports Syncfusion.Windows.Forms.Tools
Public Partial Class InstallationWizard
Inherits Form
Private wizardControl1 As WizardControl
Private welcomePage As WizardControlPage
Private licensePage As WizardControlPage
Private installPage As WizardControlPage
Private finishPage As WizardControlPage
Public Sub New()
InitializeComponent()
CreateWizard()
End Sub
Private Sub CreateWizard()
' Create wizard control
wizardControl1 = New WizardControl With {
.Dock = DockStyle.Fill,
.Style = Syncfusion.Windows.Forms.Tools.Wizard.Style.Metro
}
' Create pages
welcomePage = New WizardControlPage With {
.Title = "Welcome",
.Description = "Welcome to the Installation Wizard",
.BackVisible = False
}
licensePage = New WizardControlPage With {
.Title = "License Agreement",
.Description = "Please read and accept the license terms"
}
installPage = New WizardControlPage With {
.Title = "Installing",
.Description = "Please wait while files are being installed"
}
finishPage = New WizardControlPage With {
.Title = "Completed",
.Description = "Installation completed successfully",
.NextVisible = False,
.CancelVisible = False,
.FinishVisible = True
}
' Add pages to wizard
wizardControl1.WizardPages = New WizardControlPage() {
welcomePage,
licensePage,
installPage,
finishPage
}
' Add wizard to form
Me.Controls.Add(wizardControl1)
Me.Text = "Setup Wizard"
Me.Size = New Size(600, 450)
End Sub
End Classpublic partial class RegistrationWizard : Form
{
private WizardControlPage personalInfoPage;
private TextBox txtName;
private TextBox txtEmail;
private void SetupWizard()
{
personalInfoPage = new WizardControlPage
{
Title = "Personal Information",
Description = "Please enter your details"
};
// Add controls to page
txtName = new TextBox { Location = new Point(20, 20), Width = 300 };
txtEmail = new TextBox { Location = new Point(20, 60), Width = 300 };
personalInfoPage.Controls.Add(new Label
{
Text = "Name:",
Location = new Point(20, 0)
});
personalInfoPage.Controls.Add(txtName);
personalInfoPage.Controls.Add(new Label
{
Text = "Email:",
Location = new Point(20, 40)
});
personalInfoPage.Controls.Add(txtEmail);
// Subscribe to validation event
personalInfoPage.ValidatePage += PersonalInfoPage_ValidatePage;
}
private void PersonalInfoPage_ValidatePage(object sender,
System.ComponentModel.CancelEventArgs e)
{
// Validate name
if (string.IsNullOrWhiteSpace(txtName.Text))
{
MessageBox.Show("Please enter your name.", "Validation Error",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
e.Cancel = true;
txtName.Focus();
return;
}
// Validate email
if (string.IsNullOrWhiteSpace(txtEmail.Text) ||
!txtEmail.Text.Contains("@"))
{
MessageBox.Show("Please enter a valid email address.",
"Validation Error",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
e.Cancel = true;
txtEmail.Focus();
return;
}
}
}public partial class ConfigurationWizard : Form
{
private WizardControlPage typePage;
private WizardControlPage basicSettingsPage;
private WizardControlPage advancedSettingsPage;
private RadioButton rbBasic;
private RadioButton rbAdvanced;
private void SetupDynamicWizard()
{
typePage = new WizardControlPage
{
Title = "Configuration Type",
Description = "Choose your configuration level"
};
rbBasic = new RadioButton
{
Text = "Basic Configuration",
Location = new Point(20, 20),
Checked = true
};
rbAdvanced = new RadioButton
{
Text = "Advanced Configuration",
Location = new Point(20, 50)
};
typePage.Controls.Add(rbBasic);
typePage.Controls.Add(rbAdvanced);
basicSettingsPage = new WizardControlPage
{
Title = "Basic Settings",
Description = "Configure basic options"
};
advancedSettingsPage = new WizardControlPage
{
Title = "Advanced Settings",
Description = "Configure advanced options"
};
// Set dynamic page sequence
typePage.NextClick += TypePage_NextClick;
}
private void TypePage_NextClick(object sender, EventArgs e)
{
// Dynamically set next page based on selection
if (rbBasic.Checked)
{
typePage.NextPage = basicSettingsPage;
}
else
{
typePage.NextPage = advancedSettingsPage;
}
}
}public partial class DataImportWizard : Form
{
private Label lblProgress;
private void SetupProgressWizard()
{
// Create progress label in banner
lblProgress = new Label
{
Text = "Step 1 of 4",
Location = new Point(400, 10),
AutoSize = true,
Font = new Font("Arial", 9, FontStyle.Bold)
};
// Add to wizard's banner panel (assuming gradientPanel1 is banner)
wizardControl1.BannerPanel.Controls.Add(lblProgress);
// Subscribe to page changes
wizardControl1.BeforePageSelect += WizardControl1_BeforePageSelect;
}
private void WizardControl1_BeforePageSelect(object sender, EventArgs e)
{
// Update progress based on current page
int currentIndex = wizardControl1.WizardPages.IndexOf(
wizardControl1.SelectedWizardPage);
int totalPages = wizardControl1.WizardPages.Count;
lblProgress.Text = $"Step {currentIndex + 1} of {totalPages}";
}
}| Property | Type | Description |
|---|---|---|
| | Collection of wizard pages |
| | Currently displayed page |
| | Panel containing banner controls |
| | Picture box for banner image |
| | Label displaying page title |
| | Label displaying page description |
| | Back navigation button |
| | Next navigation button |
| | Cancel button |
| | Finish button |
| | Help button |
| | Visual theme (Default, Metro, Office) |
| | Whether Back button triggers validation |
| | Automatically layout banner controls |
| | Automatically layout title label |
| | Automatically layout description label |
| Property | Type | Description |
|---|---|---|
| | Page title text |
| | Page description text |
| | Back button visibility |
| | Next button visibility |
| | Cancel button visibility |
| | Finish button visibility |
| | Help button visibility |
| | Back button enabled state |
| | Next button enabled state |
| | Cancel button enabled state |
| | Finish button enabled state |
| | Help button enabled state |
| | Hide banner for full-page content |
| | Custom next page override |
| | Custom previous page override |
| | Position cancel over finish button |
| | Unique identifier for page |
Syncfusion.Tools.Windows.dllSyncfusion.Windows.Forms.Tools