468,119 Members | 2,072 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Image Property in the designer

I am trying to create image property that will work in the designer. I want
the image to be written to the resource file for the class.

Here is what I have so far, but I am running into a wall here. The property
comes up okay in the designer with the drill button and the file selector.
But after I choose an Image file, nothing happens. The property remains
(none).

If you have any info on how to achieve this it would be greatly appreciated.

Code snippit:

[Category("Behavior"),
Browsable(true),
TypeConverter(typeof(ImageConverter)),
EditorAttribute(typeof(ImageEditor),typeof(UITypeE ditor))]
public System.Drawing.Image Image{
get { return mImage; }
set { mImage = null; }
}
Nov 16 '05 #1
1 1453
Take a look at your set{} code.
You need to say set { mImage = value; }

"Adam Dockter" <ad**@cu.net> wrote in message
news:O1**************@tk2msftngp13.phx.gbl...
I am trying to create image property that will work in the designer. I
want
the image to be written to the resource file for the class.

Here is what I have so far, but I am running into a wall here. The
property
comes up okay in the designer with the drill button and the file selector.
But after I choose an Image file, nothing happens. The property remains
(none).

If you have any info on how to achieve this it would be greatly
appreciated.

Code snippit:

[Category("Behavior"),
Browsable(true),
TypeConverter(typeof(ImageConverter)),
EditorAttribute(typeof(ImageEditor),typeof(UITypeE ditor))]
public System.Drawing.Image Image{
get { return mImage; }
set { mImage = null; }
}

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by newbie_csharp | last post: by
2 posts views Thread by Don Tucker | last post: by
3 posts views Thread by euan | last post: by
reply views Thread by Claudio Di Flumeri | last post: by
2 posts views Thread by sklett | last post: by
3 posts views Thread by bbrewder | last post: by
14 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.