|
Using the designer First, you have to make sure you have added the components in the Syncfusion.Tools assembly to your toolbox. You do this by right-clicking your toolbox and selecting the components from the above assembly that you find listed under .NET Framework Components. Once you have the Syncfusion components in your toolbox, you drag-and-drop the XPTaskBar component onto your form. Then use the XPTaskBar’s "Add Menu Category" to add XPTaskBarBoxes to the bar. You can add one or more items to the boxes through the property browser. In Code In code, creating an XPBarControl is simple:C# XPTaskBarBox taskBarBox1 = new XPTaskBarBox(); taskBarBox1.HeaderBackColor = Color.Blue;taskBarBox1.ImageList = this.imageList1;taskBarBox1.Text = "Header Text"; taskBarBox1.ItemBackColor = Color.WhiteSmoke; taskBarBox1.Items.Add(new XPTaskBarItem("Item 1", Color.Black, 0, "Tag1")); taskBarBox1.Items.Add(new XPTaskBarItem("Item 2", Color.Black, 0, "Tag2")); taskBarBox1.ItemClick += new ItemClickHandler(taskMenuBox_ItemClick); XPTaskBarBox taskBarBox2 = new XPTaskBarBox(); taskBarBox2.HeaderBackColor = Color.Blue; taskBarBox2.ImageList = this.imageList1; taskBarBox2.Text = "Another Header Text"; taskBarBox2.ItemBackColor = Color.WhiteSmoke; taskBarBox2.Items.Add(new XPTaskBarItem("Item 3", Color.Black, 0, "Tag3")); taskBarBox2.ItemClick += new ItemClickHandler(this.taskMenuBox_ItemClick); XPTaskBar xpTaskBar1 = new XPTaskBar(); this.xpTaskBar1.Controls.Add(taskBarBox1); this.xpTaskBar1.Controls.Add(taskBarBox2); VB taskBarBox1 As XPTaskBarBox = New XPTaskBarBox() taskBarBox1.HeaderBackColor = Color.Blue taskBarBox1.ImageList = Me.imageList1 taskBarBox1.Text = "Header Text" taskBarBox1.ItemBackColor = Color.WhiteSmoke taskBarBox1.Items.Add(New XPTaskBarItem("Item 1", Color.Black, 0, "Tag1")) taskBarBox1.Items.Add(New XPTaskBarItem("Item 2", Color.Black, 0, "Tag2")) taskBarBox1.ItemClick += New ItemClickHandler(taskMenuBox_ItemClick) taskBarBox2 As XPTaskBarBox = New XPTaskBarBox() taskBarBox2.HeaderBackColor = Color.Blue taskBarBox2.ImageList = Me.imageList1 taskBarBox2.Text = "Another Header Text" taskBarBox2.ItemBackColor = Color.WhiteSmoke taskBarBox2.Items.Add(New XPTaskBarItem("Item 3", Color.Black, 0, "Tag3")) taskBarBox2.ItemClick += New ItemClickHandler(Me.taskMenuBox_ItemClick) xpTaskBar1 As XPTaskBar = New XPTaskBar() Me.xpTaskBar1.Controls.Add(taskBarBox1) Me.xpTaskBar1.Controls.Add(taskBarBox2) |