Here is A Gradient Panel Control
Add New Class & Add The Following Code
Inherits Panel
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim control As Color = SystemColors.Control
Dim window As Color = SystemColors.Window
Dim formGraphics As Graphics = e.Graphics
Dim gradientBrush As New Drawing2D.LinearGradientBrush(New Point(0, 0), New Point(Width, 0), clr1, clr2)
formGraphics.FillRectangle(gradientBrush, ClientRectangle)
' Dim p As New Drawing2D.GraphicsPath
' p.StartFigure()
' p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
' p.AddLine(40, 0, Me.Width - 40, 0)
' p.AddArc(New Rectangle(Me.Width - 40, 0, 40, 40), -90, 90)
' p.AddLine(Me.Width, 40, Me.Width, Me.Height - 40)
' p.AddArc(New Rectangle(Me.Width - 40, Me.Height - 40, 40, 40), 0, 90)
'p.AddLine(Me.Width - 40, Me.Height, 40, Me.Height)
'p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
' p.CloseFigure()
End Sub
Dim clr1 As Color = Color.White
Dim clr2 As Color = Color.White
Property color1() As Color
Get
color1 = clr1
End Get
Set(ByVal value As Color)
clr1 = value
End Set
End Property
Property Color2() As Color
Get
Color2 = clr2
End Get
Set(ByVal value As Color)
clr2 = value
End Set
End Property
Inherits Panel
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim control As Color = SystemColors.Control
Dim window As Color = SystemColors.Window
Dim formGraphics As Graphics = e.Graphics
Dim gradientBrush As New Drawing2D.LinearGradientBrush(New Point(0, 0), New Point(Width, 0), clr1, clr2)
formGraphics.FillRectangle(gradientBrush, ClientRectangle)
' Dim p As New Drawing2D.GraphicsPath
' p.StartFigure()
' p.AddArc(New Rectangle(0, 0, 40, 40), 180, 90)
' p.AddLine(40, 0, Me.Width - 40, 0)
' p.AddArc(New Rectangle(Me.Width - 40, 0, 40, 40), -90, 90)
' p.AddLine(Me.Width, 40, Me.Width, Me.Height - 40)
' p.AddArc(New Rectangle(Me.Width - 40, Me.Height - 40, 40, 40), 0, 90)
'p.AddLine(Me.Width - 40, Me.Height, 40, Me.Height)
'p.AddArc(New Rectangle(0, Me.Height - 40, 40, 40), 90, 90)
' p.CloseFigure()
End Sub
Dim clr1 As Color = Color.White
Dim clr2 As Color = Color.White
Property color1() As Color
Get
color1 = clr1
End Get
Set(ByVal value As Color)
clr1 = value
End Set
End Property
Property Color2() As Color
Get
Color2 = clr2
End Get
Set(ByVal value As Color)
clr2 = value
End Set
End Property
Note: only a member of this blog may post a comment.