This is verbatim from a book...
VB Code:
Private Sub frmMain_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint Dim g As Graphics = Me.CreateGraphics() Dim x As Integer = Me.Width Dim y As Integer = Me.Height Dim lgb As LinearGradientBrush = New LinearGradientBrush(New Point(0, 0), New Point(x, y), Color.White, Color.Red) g.FillRectangle(lgb, 0, 0, x, y) End Sub
It doesn't seem to do anything at all. It's supposed to show a gradient effect on the form, from white to red, top left to bottom right.
Can anyone get it working?




Reply With Quote