Click here to Skip to main content
15,906,624 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I use a clear() method in button click event, after save a data in a database the clear() method will call automatically.The clear() method contains the following codes.

SQL
txtName.Text = "";
          txtAddress.Text = "";
          txtPhoneNo.Text = "";
          cmbQualification.SelectedIndex = 0;
          cmbStream.SelectedIndex = 0;
          cmbJobType.SelectedIndex = 0;
          dtpDtaeofApply.Value = DateTime.Now;
          cmbLocation.SelectedIndex = 0;
          cmbSubLocationInd.SelectedIndex = 0;
          cmbSubLocationFgn.SelectedIndex = 0;
          txtPassPortNo.Text = "";
          txtAmount.Text = "";
          txtCharge.Text = "";



Now my question is, In my button click event , i add image in picture box, after saved in a database, the clear() method will call.At that time, that picture box should be unload(empty).How can do this? Kindly help me..


I got answer from you like this,

picturebox1.image=null;

This line is not unload the image from picture box..Kindly help..

Thanks,
Viswanathan.M
Posted
Updated 12-Aug-11 5:46am
v3

Set the image in the control to null
 
Share this answer
 
Try this.
C#
PictureBox1.Image.Dispose();
PictureBox1.Image = null
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900