|
-
May 17th, 2004, 05:26 AM
#1
Why doesnt this code work?
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?
I don't live here any more.
-
May 17th, 2004, 05:38 AM
#2
Retired VBF Adm1nistrator
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
May 17th, 2004, 05:44 AM
#3
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
May 17th, 2004, 06:23 AM
#4
Doh! There's me thinking that panels are transparent.
I don't live here any more.
-
May 17th, 2004, 06:25 AM
#5
Retired VBF Adm1nistrator
Ahhhhh ya have to laugh
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|