Draw Panel Gradient [Resolved]
Greetings all,
I need code modification help for the code below. It's part of a gradient draw on a form but I want to use custom colors in HEX
like below or the translated RGB format instead of the standard Green to Pale Green etc.. format. Any examples how it could be done?
Code:
Private Sub DrawGradient(ByVal color1 As Color, ByVal color2 As Color, ByVal mode As System.Drawing.Drawing2D.LinearGradientMode)
Dim a As New System.Drawing.Drawing2D.LinearGradientBrush(New RectangleF(0, 0, Me.Width, Me.Height), color1, color2, mode)
Dim g As Graphics = Me.CreateGraphics
g.FillRectangle(a, New RectangleF(0, 0, Me.Width, Me.Height))
g.Dispose()
End Sub
Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
DrawGradient(Color.#33CC33, Color.#009900, Drawing.Drawing2D.LinearGradientMode.Vertical)
End Sub