Home All Groups Group Topic Archive Search About

picturebox image property

Author
25 Mar 2005 5:58 AM
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.

Author
25 Mar 2005 8:24 AM
Kevin Yu [MSFT]
Hi Jeff,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you cannot browse for a picture to
display it on the Picturebox. If there is any misunderstanding, please feel
free to let me know.

I have tried it on my machine. However, currently, I didn't reproduced it.
If you create a new Smart Device application, does this happen again? If it
doesn't, there might be some thing wrong with the project. I'd be
appreciate if you could send me the project with repro steps that can
reproduce this issue. It will be easier for me to troubleshoot on this.
Removing 'online' from the no spam alias is my email. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Are all your drivers up to date? click for free checkup

Author
25 Mar 2005 1:40 PM
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Author
25 Mar 2005 8:56 PM
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.


Show quoteHide quote
"Jeff" <jeff@newsgroup.nospam> wrote in message
news:%23nl6m%23PMFHA.3076@TK2MSFTNGP14.phx.gbl...
> 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.
>
>
>
Author
26 Mar 2005 5:09 AM
Kevin Yu [MSFT]
You're welcome, Jeff. Thanks for sharing your experience with all the
people here. If you have any questions, please feel free to post them in
the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Bookmark and Share