Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8733551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:40:14+00:00 2026-06-13T09:40:14+00:00

None of the code that I have seen so far to clear a picturebox

  • 0

None of the code that I have seen so far to clear a picturebox achieved what I needed.
I wanted to clear a picturebox so that I can draw something new over a “blank” background.

Here is my code:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    PictureBoxClear(Me.PictureBox1)

    m_i = m_i + 1
    Dim nPT As New Point(0, 0)
    Me.ImageList1.Draw(Me.PictureBox1.CreateGraphics, nPT, m_i)

End Sub
Public Sub PictureBoxClear(ByRef pb As PictureBox)

    pb.Image = Nothing

End Sub

Saying

 .Image = Nothing

seems to completely remove the image so that I can not really draw something over it afterwards.
I just wanted to clear my picturebox so that it would then ready be get some drawing again.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:40:15+00:00Added an answer on June 13, 2026 at 9:40 am

    You can try replacing it with a brand new image:

    pb.Image =  New Bitmap(pb.ClientSize.Width, pb.ClientSize.Height)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi. I have the following code that can also be seen live here: http://designliving.tk/test.html
I have seen a few questions that are like mine, but none that actually
I have seen a couple of questions that have been resolved but none are
I've seen a few similar posts to my problem, but none that have helped
I have a year's experience writing client code but none with server stuff. I
I can't understand how works the code below: class Host: name = None fileList
How can i reset a display:none and add some value here is the code
I have this piece of code, <div id=event style=display:none;> <!-- initially hidden --> <div
I'm trying to test some python code that uses urllib2 and lxml. I've seen
I have seen many Q's on this subject but none are exactly what I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.