Styling in Windows Forms Rating Control (Rating)

4 Oct 20232 minutes to read

Styling of shapes can be done either by using predefined visual styles or by BackColor, BorderColor, HighlightColor, SelectionColor and GradientColor settings.

Built-in

Rating control supports predefined visual styles such as Default, Office2007, Office2010, Metro, Office2016ColorFul, Office2016DarkGray, Office2016White, Office2016Black for Office Styles. The style can be set by the VisualStyle property.

  • C#
  • this.ratingControl1.VisualStyle = Syncfusion.Windows.Forms.Tools.RatingControl.Style.Office2016ColorFul;
  • VB.NET
  • Me.ratingControl1.VisualStyle = Syncfusion.Windows.Forms.Tools.RatingControl.Style.Office2016ColorFul

    Visual style

    OfficeColorScheme for Rating Control can be set using below code

  • C#
  • this.ratingControl1.OfficeColorScheme = Syncfusion.Windows.Forms.Tools.OfficeColorSchemes.Blue;
  • VB.NET
  • Me.ratingControl1.OfficeColorScheme = Syncfusion.Windows.Forms.Tools.OfficeColorSchemes.Blue

    Visual style

    Custom

    The properties ItemHighlightStartColor, ItemHighlightEndColor, ItemSelectionStartColor, ItemSelectionEndColor are applied only if the ApplyGradientColors property is enabled.

  • C#
  • this.ratingControl3.ItemHighlightEndColor = Color.Red;
    
    this.ratingControl3.ItemHighlightStartColor = Color.Green;
    
    this.ratingControl3.ItemSelectionEndColor = Color.Yellow;
    
    this.ratingControl3.ItemSelectionStartColor = Color.LightYellow;
  • VB.NET
  • Me.ratingControl3.ItemHighlightEndColor = Color.Red
    
    Me.ratingControl3.ItemHighlightStartColor = Color.Green
    
    Me.ratingControl3.ItemSelectionEndColor = Color.Yellow
    
    Me.ratingControl3.ItemSelectionStartColor = Color.LightYellow
  • C#
  • this.ratingControl1.ApplyGradientColors = true;
  • VB.NET
  • Me.ratingControl1.ApplyGradientColors = True

    style