Getting Started in Windows Forms xp task pane (XPTaskPane)
6 Oct 20224 minutes to read
This section describes how to add XPTaskPane control in a Windows Forms application and overview of its basic functionalities.
Assembly deployment
Refer control dependencies section to get the list of assemblies or NuGet package needs to be added as reference to use the control in any application.
Please find more details regarding how to install the nuget packages in windows form application in the below link:
Creating simple application with XPTaskPane
You can create the Windows Forms application with XPTaskPane control as follows:
Creating the project
Create a new Windows Forms project in the Visual Studio to display the XPTaskPane with functionalities.
Adding control via Form designer
The XPTaskPane control can be added to the application by dragging it from the toolbox and dropping it in a designer view. The following required assembly references will be added automatically:
- Syncfusion.Grid.Base.dll
- Syncfusion.Grid.Windows.dll
- Syncfusion.Shared.Base.dll
- Syncfusion.Shared.Windows.dll
- Syncfusion.Tools.Base.dll
- Syncfusion.Tools.Windows.dll
Adding TaskPane pages
To add pages into XPTaskPane, Click on Add Page in Smart Tags of XPTaskPane in designer view. On dropping XPTaskPane, WizardContainer will be automatically added as TaskPanePageContainer.
Adding control manually using code
To add control manually in C#, follow the given steps:
Step 1 - Add the following required assembly references to the project:
* Syncfusion.Grid.Base.dll
* Syncfusion.Grid.Windows.dll
* Syncfusion.Shared.Base.dll
* Syncfusion.Shared.Windows.dll
* Syncfusion.Tools.Base.dll
* Syncfusion.Tools.Windows.dll
Step 2 - Include the namespaces Syncfusion.Windows.Forms.Tools.
using Syncfusion.Windows.Forms.Tools;
Imports Syncfusion.Windows.Forms.Tools
Step 3 - Create XPTaskPane control instance and add it to the form.
XPTaskPane xpTaskPane1 = new XPTaskPane();
this.Controls.Add(xpTaskPane1);
Dim xpTaskPane1 As XPTaskPane = New XPTaskPane()
Me.Controls.Add(xpTaskPane1)
Adding WizardContainer as TaskPanePageContainer
To added pages into XPTaskPane, it is necessary to added a Container control for TaskPanePage. Here WizardContainer is added as TaskPanePageContainer.
WizardContainer wizardContainer1 = new WizardContainer();
this.xpTaskPane1.Controls.Add(this.wizardContainer1);
this.xpTaskPane1.TaskPanePageContainer = this.wizardContainer1;
Dim wizardContainer1 As WizardContainer = New WizardContainer()
Me.xpTaskPane1.Controls.Add(Me.wizardContainer1);
Me.xpTaskPane1.TaskPanePageContainer = Me.wizardContainer1;
Adding XPTaskPage
Create an instance of XPTaskPage class and add it to TaskPages collection in XPTaskPane.
XPTaskPage xpTaskPage1 = new XPTaskPage();
this.xpTaskPage1.Title = "New Page";
this.wizardContainer1.Controls.Add(this.xpTaskPage1);
this.xpTaskPane1.TaskPages = new XPTaskPage[] {
this.xpTaskPage1};
Dim xpTaskPage1 As XPTaskPage = New XPTaskPage()
Me.xpTaskPage1.Title = "New Page"
Me.wizardContainer1.Controls.Add(me.xpTaskPage1)
Me.xpTaskPane1.TaskPages = New XPTaskPage[] {
Me.xpTaskPage1};