quick question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

does anyone know how i can clear an image from a picture box?
I tried
PictureBox1.Image = ""
but this does not work!!


Can anyone help?
 
Hi

this does not seem to work
It says that null is no longer supported and that i should use dbnull instead
I tried usin
PictureBox3.Image = dbnul

but this does not work either. The DBNull word is highligted and i get a message statin
'DBNull' is a type and cannot be used as an expressio

does anyone know how to do this?
 
Not sure if you are doing C# of VB, but you might try setting the
Image to Nothing.
 
Hi

Im using vb.net

do u mean i should try....

If CBoxRemoveEquip.Text = "Sun Lounger" The
PictureBox7.Image = Image.FromFile("C:\Documents and Settings\Desktop\Sun
Lounger.jpg"
ElseIf CBoxRemoveEquip.Text = "VCR" The
PictureBox7.Image = Image.FromFile("C:\Documents and Settings\vcr.jpg"
Els
PictureBox3.Image = Nothin

this code loads the picturebox with the correct image when the Sun Lounger or VCR is selected from the combobox. What it still doesnt do is get rid of the picture if anything else is selected
 
Aha, i have solved it. It was a stupid mistake i made with the control names.

thank u all for your help.
:)
 
if you're using C# then set it to
null instead of
[color=blue:34f76ce026]""[/color:34f76ce026] and if you're using
VB.NET i supose it'd be
[color=blue:34f76ce026]Nothing[/color:34f76ce026]...

hope that helps...
 
Back
Top