)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the header foreground of WinForms XPTaskBar while apply other than default style?

Platform: WinForms |
Control: XPTaskbar |
Published Date: June 21, 2018 |
Last Revised Date: February 6, 2020 |
.NET Framework: 4

Customize the header foreground

XPTaskBar ForeColor and BackColor appearance has been customized based on its Visual Style. Hence to use different Visual Style in XPTaskBar other than default, it is needed to enable property named UseCustomColors. The following code demonstrates the same.

C#

this.xpTaskBar1.Style = Syncfusion.Windows.Forms.Tools.XPTaskBarStyle.Metro;
XPTaskBarBox taskBarBox1 = new XPTaskBarBox();
taskBarBox1.HeaderForeColor = Color.Yellow;
taskBarBox1.HeaderBackColor = Color.FromArgb(17, 158, 218);
taskBarBox1.Text = "Header Text";
taskBarBox1.ItemBackColor = Color.White;
taskBarBox1.Items.Add(new XPTaskBarItem("Item 1", Color.Black, 0, "Tag1"));
taskBarBox1.Items.Add(new XPTaskBarItem("Item 2", Color.Black, 0, "Tag2"));
 
//To set Header fore color for the styles other than default
taskBarBox1.UseCustomColors = true;
XPTaskBarBox taskBarBox2 = new XPTaskBarBox();
taskBarBox2.HeaderBackColor = Color.FromArgb(17, 158, 218);
taskBarBox2.HeaderForeColor = Color.Lime;
taskBarBox2.Text = "Another Header Text";
taskBarBox2.ItemBackColor = Color.White;
taskBarBox2.Items.Add(new XPTaskBarItem("Item 3", Color.Black, 0, "Tag3"));
 
//To set Header fore color for the styles other than default
taskBarBox2.UseCustomColors = true;
this.xpTaskBar1.Controls.Add(taskBarBox1);
this.xpTaskBar1.Controls.Add(taskBarBox2);

VB

Me.xpTaskBar1.Style = Syncfusion.Windows.Forms.Tools.XPTaskBarStyle.Metro
Dim taskBarBox1 As New XPTaskBarBox()
taskBarBox1.HeaderForeColor = Color.Yellow
taskBarBox1.HeaderBackColor = Color.FromArgb(17, 158, 218)
taskBarBox1.Text = "Header Text"
taskBarBox1.ItemBackColor = Color.White
taskBarBox1.Items.Add(New XPTaskBarItem("Item 1", Color.Black, 0, "Tag1"))
taskBarBox1.Items.Add(New XPTaskBarItem("Item 2", Color.Black, 0, "Tag2"))
 
'To set Header fore color for the styles other than default
taskBarBox1.UseCustomColors = True
Dim taskBarBox2 As New XPTaskBarBox()
taskBarBox2.HeaderBackColor = Color.FromArgb(17, 158, 218)
taskBarBox2.HeaderForeColor = Color.Lime
taskBarBox2.Text = "Another Header Text"
taskBarBox2.ItemBackColor = Color.White
taskBarBox2.Items.Add(New XPTaskBarItem("Item 3", Color.Black, 0, "Tag3"))
 
'To set Header fore color for the styles other than default
taskBarBox2.UseCustomColors = True
Me.xpTaskBar1.Controls.Add(taskBarBox1)
Me.xpTaskBar1.Controls.Add(taskBarBox2)

Screenshot

Show changed header foreground

 

Samples:

C#:  XPTaskBarSample

VB: XPTaskBarSample

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon