473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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 17955


--
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Liz | last post by:
All: Can anyone tell me why my animated GIF does not show up as animated when put into a pictureBox?? Thanks. Liz
1
by: John | last post by:
I use drawline and drawstring to create something in a picturebox and want to save the content of that picturebox as a bitmap, is that possible and how? Thank.
1
by: John | last post by:
I have a picturebox that displays images from a camera through a third party dll. When the image is displayed, MyPicturebox.Image is nothing. So I want to know in situation like this, how to copy...
0
by: Vincent | last post by:
Dear all, I have implemented a class to export the content of RichTextBox to image in WYSISYG mode so that line breaks on the screen are the same as exported. C# Code: public struct...
0
by: tamasumalta | last post by:
I have done some code to load a picture in an array of bytes. The data is saved in a file in the Hard drive. There is also another piece of code to display the image. My issue is that I need to...
2
by: cshaw | last post by:
Hello Everyone, I am having problems with a listbox control. I have a page with a couple of labels and drop-down lists at the top, and then below there is a table with two columns, the first column...
9
by: jad2006 | last post by:
Hi guys We have a requirement like in one iframe we have to show one site and in another iframe we have to show some other external site, we did it using <iframe src="http://www.a.com">...
1
by: Nitin | last post by:
Hi! I've been trying to draw in a PictureBox and save the resulting image to a Bitmap object that I save to a file on disk. Unfortunately, I can't seem to get the elements that I'm drawing to...
12
by: Mads Aggerholm | last post by:
Hello Sirs I hope you can give me a hint to this little problem. The thing is, I have for a lang time enjoyed the comics on www.washintonpost.com, and I allways start the day by going to their...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.