Results 1 to 4 of 4

Thread: [RESOLVED] [2005] clearing drawn lines from a form

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    42

    Resolved [RESOLVED] [2005] clearing drawn lines from a form

    Having now harnessed the power of drawing lines (newby ) is there a way/command to clear the form of these lines.

    Im doing the following when a button is pressed to draw some lines:

    Dim this_graphics As Graphics = CreateGraphics()
    this_graphics.DrawLine(pens.red, point1, point2)

    Cheers

  2. #2

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    42

    Re: [2005] clearing drawn lines from a form

    okay, trawling says theres a command for clearing....

    g.graphics.clear(colour)

    genius

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] [2005] clearing drawn lines from a form

    You're going about this the wrong way, as evidenced by the fact that you're calling CreateGraphics. Also, you're clearing a colour, which isn't clearing the lines you've drawn specifically.

    Follow the GDI+ tutorial link in my signature and read their #1 FAQ question, then checkout my simple drawing program submission in the CodeBank.

    http://www.vbforums.com/showthread.php?t=426684
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2006
    Posts
    42

    Re: [RESOLVED] [2005] clearing drawn lines from a form

    Ah, youre right, thanks for that.

    Ill get reading that!

    ta

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