469,270 Members | 1,285 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

checking if a picturebox has content

hello,

i'm wondering how i can check if an picturebox has any content(as in got an
image).

thanks in advanced.

angus
Nov 21 '05 #1
6 17064


--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"angus" <an***@discussions.microsoft.com> schreef in bericht
news:FF**********************************@microsof t.com...
hello,

i'm wondering how i can check if an picturebox has any content(as in got an image).

thanks in advanced.

angus

Nov 21 '05 #2
Sorry for the blank post,

I clicked to fast,

you can check to see if the picturebox is empty like this:

if picturebox1.image is nothing then
msgbox("I'm empty")
end if

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"angus" <an***@discussions.microsoft.com> schreef in bericht
news:FF**********************************@microsof t.com...
hello,

i'm wondering how i can check if an picturebox has any content(as in got an image).

thanks in advanced.

angus

Nov 21 '05 #3
It's Image property will not be "Nothing".

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"angus" <an***@discussions.microsoft.com> wrote in message
news:FF**********************************@microsof t.com...
hello,

i'm wondering how i can check if an picturebox has any content(as in got
an
image).

thanks in advanced.

angus

Nov 21 '05 #4
"angus" <an***@discussions.microsoft.com> schrieb:
i'm wondering how i can check if an picturebox has any content(as in got
an
image).


\\\
If Me.PictureBox1.Image Is Nothing Then
...
End If
///

Alternatively you can use the 'IsNothing' function.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5
then what is the differnce between "is" and "=" in VB .net ?

"Peter Proost" wrote:
Sorry for the blank post,

I clicked to fast,

you can check to see if the picturebox is empty like this:

if picturebox1.image is nothing then
msgbox("I'm empty")
end if

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"angus" <an***@discussions.microsoft.com> schreef in bericht
news:FF**********************************@microsof t.com...
hello,

i'm wondering how i can check if an picturebox has any content(as in got

an
image).

thanks in advanced.

angus


Nov 21 '05 #6
Angus

With = you can see if a value of a property = Something

With "Is" you can see of the address of a referenced object is Something

I hope this helps,

Cor
Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by John | last post: by
1 post views Thread by John | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.