Imports System.Drawing.Drawing2DPublic Class Form1
Dim lgBrush As New LinearGradientBrush(Me.ClientRectangle, Color.White, Color.Blue, 130)
Private Sub rang()
Dim cb As New ColorBlend(5) ' 5 is count of color which sets to Brush
cb.Colors = New Color() {Color.Red, Color.Blue, Color.Gold, Color.Black, Color.Brown, Color.Lime}
cb.Positions = New Single() {0.0F, 0.2F, 0.4F, 0.6F, 0.8F, 1.0F}
lgBrush.InterpolationColors = cb
End Sub
Private Sub Button1_Paint(sender As Object, e As PaintEventArgs) Handles Button1.Paint
Call rang()
e.Graphics.FillRectangle(lgBrush, Me.ClientRectangle)
End Sub
End Class