Listing 1: VB.NET gradient user control

    Private _startColor As Int32 = Color.Black.ToArgb()
    Private _endColor As Int32 = Color.Silver.ToArgb()

    Public Property startColor() As Int32
        Get
            Return _startColor
        End Get
        Set(ByVal value As Int32)
            _startColor = value
            Invalidate()
            Update()
        End Set
    End Property

    Public Property endColor() As Int32
        Get
            Return _endColor
        End Get
        Set(ByVal value As Int32)
            _endColor = value
            Invalidate()
            Update()
        End Set
    End Property


    Private Sub InteropUserControl_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs)
	 Handles Me.Paint
        Dim theBackground As System.Drawing.Drawing2D.LinearGradientBrush
        theBackground = New System.Drawing.Drawing2D.LinearGradientBrush( _
            New Point(0, 0), _
            New Point(0, ClientSize.Height), _
            Color.FromArgb(255, ColorTranslator.FromWin32(_startColor)), _
            Color.FromArgb(255, ColorTranslator.FromWin32(_endColor)))
        e.Graphics.FillRectangle(theBackground, ClientRectangle)
    End Sub