Results 1 to 4 of 4

Thread: how to draw line in picturebox to represent axis-x,axis-y

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    Smile how to draw line in picturebox to represent axis-x,axis-y

    i want draw a line graph in picture box. How to write the code to draw line represent axis x and axis y. how to put the value behide axis -x and axis -y? thanks.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    Re: how to draw line in picturebox to represent axis-x,axis-y

    why use the form load , the code cannot function but using the command_click the code can function. how to make it function when form load?

    Code:
    Private Sub Command1_Click()
        Picture1.Line (30, 30)-(30, 230), vbWhite
        Picture1.Line (30, 230)-(340, 230), vbWhite
    End Sub
    Code:
    Private Sub Form_Load()
    
    Picture1.Line (30, 30)-(30, 230), vbWhite
    Picture1.Line (30, 230)-(340, 230), vbWhite
    
    End Sub

  3. #3
    Addicted Member
    Join Date
    Mar 2007
    Location
    San Pedro de Macoris, Dominican Republic
    Posts
    211

    Re: how to draw line in picturebox to represent axis-x,axis-y

    Using the event activate it works. No clue as to why it doesn't work with load.

  4. #4
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: how to draw line in picturebox to represent axis-x,axis-y

    Before you draw the lines, add these two lines of code:

    vb Code:
    1. Me.AutoRedraw = True
    2. Me.Show

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