I have developed a visual C# windows form application using Visual Studio IDE.
My problem is how to check if the user has selected an image or not.
I roughly check the Image like a String, Integer objects but it does not work
if(myPictureBox.Image == NULL){
//The Image is Null
}
You can do a check like this
bool isNullOrEmpty = myPictureBox == null || myPictureBox.Image == null;
Or you can create your own extension method
public static bool IsNullOrEmpty(this PictureBox pb)
{
return pb == null || pb.Image == null;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With