• 0

[vb.net] Gradient fill


Question

well i'm trying to create a control that inherits from textbox or richtextbox to make the background gradient

i use the following code :

   Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
        MyBase.OnPaint(e)
        Dim gbr As LinearGradientBrush = New LinearGradientBrush(New Rectangle(0, 0, Me.Width, Me.Height), Color.White, Color.Blue, LinearGradientMode.Horizontal)
        e.Graphics.FillRectangle(gbr, New Rectangle(0, 0, Me.Width, Me.Height))
    End Sub

but this isn't working... the backcolor in both is always white.

can someone help? thanks in advance ;)

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.