In some instances, you may want to add a C1Wizard control to your project in code. In this topic, you will learn how to create a C1Wizard control with two C1WizardStep objects using C# and Visual Basic code.
Complete the following steps:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Imports C1.Web.Wijmo.Controls.C1Wizard |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
using C1.Web.Wijmo.Controls.C1Wizard; |
|
Create the C1Wizard object, set its Width and Height, and then add it to your project by placing the following code in the Page_Load event:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Dim NewWizard As C1Wizard = New C1Wizard() NewWizard.Width = 300 NewWizard.Height = 200 PlaceHolder1.Controls.Add(NewWizard) |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
C1Wizard NewWizard = new C1Wizard(); NewWizard.Width = 300; NewWizard.Height = 200; PlaceHolder1.Controls.Add(NewWizard); |
|
Create three C1WizardStep objects and add them to the C1Wizard. This code should also be added to the Page_Load event.
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
'Create three C1WizardStep objects Dim C1WizardStep1 As C1WizardStep = New C1WizardStep() Dim C1WizardStep2 As C1WizardStep = New C1WizardStep() 'Set the WizardSteps' 'Text' Property C1WizardStep1.Title = "C1WizardStep1" C1WizardStep2.Title = "C1WizardStep2" 'Add the three C1WizardStep objects to the C1Wizard NewWizard.Controls.Add(C1WizardStep1) NewWizard.Controls.Add(C1WizardStep2) |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
//Create three C1WizardStep objects C1WizardStep C1WizardStep1 = new C1WizardStep(); C1WizardStep C1WizardStep2 = new C1WizardStep(); //Set the WizardSteps' 'Text' Property' C1WizardStep1.Title = "C1WizardStep1"; C1WizardStep2.Title = "C1WizardStep2"; //Add the three C1WizardStep objects to the C1Wizard NewWizard.Controls.Add(C1WizardStep1); NewWizard.Controls.Add(C1WizardStep2); |
|
Run the program.
This topic illustrates the following:
When your project is run, your C1Wizard control will resemble the following image:
