picturebox image property

J

Jeff

I've seen a couple of posts on the Internet with others having this problem,
however, no one seems to have a good answer.

I am working on a C# Smart Device application and have been able to browse
for a PictureBox image and insert in the Visual Studio .NET 2003 PictureBox1
properties pane. Now for some reason I can't - it's grayed out. I also
cannot add an imageList control and add an image. It gives me an "Object
reference not set to an instance of an object" error message. I've tried to
use Reflection to add the image and that didn't work either although I
really don't want to do that anyway.

Anyone have any ideas?

Thanks.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

I am working on a C# Smart Device application and have been able to browse
for a PictureBox image and insert in the Visual Studio .NET 2003
PictureBox1
properties pane.

So you mean that you include a PictureBox in your form that the IDE named
PictureBox1
Now for some reason I can't - it's grayed out. I also
cannot add an imageList control and add an image. It gives me an "Object
reference not set to an instance of an object" error message.

This error is shown at runtime or design ?
I've tried to
use Reflection to add the image and that didn't work either although I
really don't want to do that anyway.

I cannot see where reflection fix here, by default the image used is added
as a resource to the assembly.


I have never had such a problem, try this , add a new form to the project
and try to insert a picturebox there and see what happens.


cheers,
 
J

Jeff

Well, that's odd. I took both posters advice and created a new project and
that worked. I created a new form in my project and that worked. I went
back to my existing form where I was having problems and now it is showing
the ability to add a graphic!!! Don't know what the original problem was -
maybe creating a new project got it unstuck or something :)

Thanks for the advice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top