)
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 apply theme or custom colors to Digital Gauge?

Platform: WinForms |
Control: Digital Gauge |
Published Date: December 14, 2017 |
Last Revised Date: May 23, 2019

Theme can be applied to Digital Gauge Control by Visual Style property. The following themes are available in Digital Gauge control,

 

  • Blue
  • Black
  • Silver
  • Custom
  • Office2016Black
  • Office2016White
  • Office2016DarkGray
  • Office2016Colorful
  • Metro

 

The following Code sample demonstrates the same.

 

C#

//For Default Theme
if ((sender as ComboBoxAdv).SelectedItem.ToString() == "None")
{
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.None;
}
 
//Blue Visuall Style
else if ((sender as ComboBoxAdv).SelectedItem.ToString() == "Blue")
{
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Blue;
}
 
//Silver Visuall Style
else if ((sender as ComboBoxAdv).SelectedItem.ToString() == "Silver")
{
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Silver;
}
 
//Black Visuall Style
else if ((sender as ComboBoxAdv).SelectedItem.ToString() == "Black")
{
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Black;
}
 
// Metro Visuall Style
else if ((sender as ComboBoxAdv).SelectedItem.ToString() == "Metro")
{
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Metro;
}
 
//Custom  Visuall Style
else if ((sender as ComboBoxAdv).SelectedItem.ToString() == "Custom")
{
Syncfusion.Windows.Forms.Gauge.DigitalGaugeThemeBrush digitalGaugeThemeBrush1 = newSyncfusion.Windows.Forms.Gauge.DigitalGaugeThemeBrush();
digitalGaugeThemeBrush1.ForeColor = System.Drawing.Color.Yellow;
digitalGaugeThemeBrush1.FrameBorderColor = System.Drawing.Color.Red;
digitalGaugeThemeBrush1.OuterFrameGradientEndColor = System.Drawing.Color.Green;
this.digitalGauge1.ThemeBrush.Add(digitalGaugeThemeBrush1);
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Custom;
 
}
 
//Office2016Black Visuall Style
else if ((sender as ComboBoxAdv).SelectedItem.ToString() == "Office2016Black")
{
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Office2016Black;
}
 
//Office2016Colorful Visuall Style
else if ((sender as ComboBoxAdv).SelectedItem.ToString() == "Office2016Colorful")
{
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Office2016Colorful;
}
 
// Office2016DarkGray Visuall Style
else if ((sender as ComboBoxAdv).SelectedItem.ToString() == "Office2016DarkGray")
{
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Office2016DarkGray;
}
 
//Office2016White Visuall Style
else if ((sender as ComboBoxAdv).SelectedItem.ToString() == "Office2016White")
{
this.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Office2016White;
}
 

 

VB

'For Default Theme
If (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "None" Then
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.None
 
 
'Blue Visuall Style
ElseIf (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "Blue" Then
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Blue
 
 
'Silver Visuall Style
ElseIf (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "Silver" Then
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Silver
 
 
'Black Visuall Style
ElseIf (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "Black" Then
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Black
 
 
' Metro Visuall Style
ElseIf (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "Metro" Then
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Metro
 
 
'Custom  Visuall Style
ElseIf (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "Custom" Then
Dim digitalGaugeThemeBrush1 As New Syncfusion.Windows.Forms.Gauge.DigitalGaugeThemeBrush()
digitalGaugeThemeBrush1.ForeColor = System.Drawing.Color.Yellow
digitalGaugeThemeBrush1.FrameBorderColor = System.Drawing.Color.Red
digitalGaugeThemeBrush1.OuterFrameGradientEndColor = System.Drawing.Color.Green
Me.digitalGauge1.ThemeBrush.Add(digitalGaugeThemeBrush1)
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Custom
 
 
'Office2016Black Visuall Style
ElseIf (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "Office2016Black" Then
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Office2016Black
 
 
'Office2016Colorful Visuall Style
ElseIf (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "Office2016Colorful" Then
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Office2016Colorful
 
 
' Office2016DarkGray Visuall Style
ElseIf (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "Office2016DarkGray" Then
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Office2016DarkGray
 
 
'Office2016White Visuall Style
ElseIf (TryCast(sender, ComboBoxAdv)).SelectedItem.ToString() = "Office2016White" Then
Me.digitalGauge1.VisualStyle = Syncfusion.Windows.Forms.Gauge.ThemeStyle.Office2016White
End If

 

Screenshot

 

Apply theme to DigitalGauge

 

Samples:

 

C#: DigitalGaugeExample

 

VB: DigitalGaugeExample

 

 

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