Results 1 to 7 of 7

Thread: Clearing a Picturebox, lol

  1. #1

    Thread Starter
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252

    Clearing a Picturebox, lol

    Wow, I'm just holding that new baby in my hands.
    Well, it seems like vb.net has flashed my mind, could
    you please help me on how to clear the content of a
    picturebox (formerly known as cls)? I'm really
    ashamed of asking such a silly question after such
    a long vb experience.

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Here ya go..
    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            PictureBox1.Image = Nothing
        End Sub

  3. #3

    Thread Starter
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252
    Ok, thank you, that looked pretty simle.
    But how about the hdc ?. For example if I
    use Rectangle(....) I will need the hdc.

  4. #4
    Tygur
    Guest
    The Rectangle API? I hope you realize that you don't need to do that, because you could use the CreateGraphics method to get a Graphics object and do your drawing through that.

  5. #5

    Thread Starter
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252
    yeah, i've just seen it in the help, thx Tygur

  6. #6

    Thread Starter
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252
    Btw, is it possible to convert vb.net code into c#?
    Maybe I should rewrite it to learn c#....

  7. #7
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Yeah it's defenitaly possible to convert VB.Net to C# code, actually it's really easy, just the syntax is a bit different... defenitely word doing in my opinion!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

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