Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to clear a picturebox? 1

Status
Not open for further replies.

Erbium

Programmer
Aug 30, 2007
22
US
Hi everyone

I'm doing a program to display pictures from a list of files in a directory, so I can type something in about them.

I have a 'skip button' that moves the pictures forward, moving first picture off the screen, second picture in to first picturebox, 3rd into 2nd box, etc.

Problem is when I get to the end of the jpegs file name list, if there are no more pictures, I tried setting the picturebox to "". This gives me an 'invalid picture' error message. If I simply skip setting it then last picture stays in the box.

I can't find any methods under help for picturebox to clear the box. Short of pointing to a jpeg of some solid color, which seems silly, how can I clear a picture box that had a picture in it?

 
I think I figured it out. After poking thru every method I think reset is supposed to do this. Haven't tried yet but should work. Anyone have the syntax of how to do the reset method?
 
Try
Code:
Me.PictureBox1.Image = Nothing

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top