|
-
Mar 16th, 2004, 09:50 AM
#4
Member
Re: Draw Lines on FormLoad???
Originally posted by Daywalker46410
I am using the following code to draw a line (this will ultimately become a table):
Code:
Private Sub DrawLines()
Dim g As Graphics
Dim PenColor As New Pen(Color.Black)
Dim APoint As New Point(30, 350)
Dim BPoint As New Point(500, 350)
g = Me.CreateGraphics
g.DrawLine(PenColor, APoint, BPoint)
End Sub
This works fine as long as I call the sub from a click event, or a text change, etc. If I call it from a Form Load or Form Activate command, it won't draw the lines. I know the code is being executed because I put a MessageBox in there for testing, but the line just isn't being drawn. Any idea what's going on and how to fix it?
Thanks in advance
Did you try putting that in the form's paint event?
Edit: I didnt see Pax already had it.
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
|