Gradient panel Appearance in Windows Forms Gradient Panel

27 Apr 20212 minutes to read

The background of the GradientPanel can be customized using the below properties.

GradientPanel Properties Description
BackColor Background color used to display the text and graphics in the control.
BackgroundColor Sets a gradient style background for the control.
this.gradientPanel1.BackColor = System.Drawing.Color.LightCoral;
this.gradientPanel1.BackgroundColor = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.PathRectangle, System.Drawing.Color.AliceBlue, System.Drawing.Color.SteelBlue);
Me.gradientPanel1.BackColor = System.Drawing.Color.LightCoral
Me.gradientPanel1.BackgroundColor = New Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.PathRectangle, System.Drawing.Color.AliceBlue, System.Drawing.Color.SteelBlue)

Windows Forms GradientPanel Image367

Foreground Settings

The foreground text in the control can be customized using the below properties.

GradientPanel Properties Description
Font Indicates the Font style of the text in the control.
ForeColor Indicates the color of the text and graphics in the control.
this.gradientPanel1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold);
this.gradientPanel1.ForeColor = System.Drawing.Color.Blue;
Me.GradientPanel1.Font = New System.Drawing.Font("Comic Sans MS", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
this.gradientPanel1.ForeColor = System.Drawing.Color.Blue;

Overview_img368

Image Settings

Background image for the GradientPanel control is set using below properties.

GradientPanel Properties Description
BackgroundImage Sets the background image for the control.
BackgroundImageLayout Specifies the layout of the image.
this.gradientPanel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("gradientPanel1.BackgroundImage")));
this.gradientPanel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
Me.gradientPanel1.BackgroundImage = CType((resources.GetObject("gradientPanel1.BackgroundImage")),System.Drawing.Image) 
Me.gradientPanel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch

Overview_img369

See Also

Border Settings