Results 1 to 5 of 5

Thread: Draw Lines on FormLoad??? [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Location
    Chicago, IL
    Posts
    102

    Draw Lines on FormLoad??? [RESOLVED]

    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
    Last edited by Daywalker46410; Mar 16th, 2004 at 09:51 AM.
    Joe Cody
    Data Integration Engineer
    Novaspect, Inc.
    Elk Grove Village, IL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width