Style Settings in Windows Forms Calculator

26 Apr 20212 minutes to read

This section discusses on the following styles:

Button Flat Styles

The flat styles for the button objects in a Calculator control is set using CalculatorControl.FlatStyle property. The styles are Flat, Popup, Standard (default) and System.

this.calculatorControl1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
Me.calculatorControl1.FlatStyle = System.Windows.Forms.FlatStyle.Flat

Calculator button flat styles

Themes and Button Styles

Themes for the Calculator Control

Essential Tools Calculator control is themed by default. To disable, set ThemesEnabled property to false.

this.calculatorControl1.ThemesEnabled = false;
Me.calculatorControl1.ThemesEnabled = False

Themes for the Calculator control

Button Styles

The Calculator control supports the below button styles. UseVisualStyle property should be set to true to enable button styles for the control.

  • Classic (default)
  • Office2000
  • WindowsXP
  • OfficeXP
  • Office2003
  • Office2007
  • Metro
this.calculatorControl1.UseVisualStyle = true;

//Setting Office2007 button style for the calculator control
this.calculatorControl1.ButtonStyle = Syncfusion.Windows.Forms.ButtonAppearance.Office2007;
Me.calculatorControl1.UseVisualStyle = True

'Setting Office2007 button style for the calculator control
Me.calculatorControl1.ButtonStyle = Syncfusion.Windows.Forms.ButtonAppearance.Office2007;

Button styles

OfficeColor Schemes

Essential Tools Calculator control supports all the three OfficeColorSchemes. When the ButtonStyle is set to Office2007 style, the color schemes will be blue by default. It can be modified using Office2007Theme property.

this.calculatorControl1.Office2007Theme = Syncfusion.Windows.Forms.Office2007Theme.Silver;
Me.calculatorControl1.Office2007Theme = Syncfusion.Windows.Forms.Office2007Theme.Silver

OfficeColor schemes

Custom Colors

We can also apply custom colors to the Calculator control by setting Office2007Theme to “Managed” and specifying the custom color through the ApplyManagedColors method as follows.

this.calculatorControl1.Office2007Theme = Syncfusion.Windows.Forms.Office2007Theme.Managed;
Office2007Colors.ApplyManagedColors(this, Color.Navy);
Me.calculatorControl1.Office2007Theme = Syncfusion.Windows.Forms.Office2007Theme.Managed;
Office2007Colors.ApplyManagedColors(Me, Color.Navy)

Custom colors