By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

Image Property on PropertyGrid

P: n/a
I am using the PropertyGrid and I have set the SelectedObject property to
an instance of my custom class. One of the properties of the custom class
is a bitmap.

The PropertyGrid lets me assign a bitmap ok, but when I want to delete it,
I cannot do it.

For example, in Visual Studio when you set the background image for a form,
you can highlight it and press delete to clear the property. But for my
own class and the PropertyGrid, it won't do this.

Can anyone shed some light on how I might accomplish this? I tried
specifying the editor as the ImageEditor using the Editor Attribute on the
property, but that made no difference.

I just want the user to be able to selcect the image property in the
PropertyGrid and press delete to clear it.

Thanks

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Add the defaultValue Attribute.

<DefaultValue(GetType(Image), Nothing)>

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net"> wrote in
message news:8d*****************************@40tude.net...
I am using the PropertyGrid and I have set the SelectedObject property to
an instance of my custom class. One of the properties of the custom class
is a bitmap.

The PropertyGrid lets me assign a bitmap ok, but when I want to delete it,
I cannot do it.

For example, in Visual Studio when you set the background image for a
form,
you can highlight it and press delete to clear the property. But for my
own class and the PropertyGrid, it won't do this.

Can anyone shed some light on how I might accomplish this? I tried
specifying the editor as the ImageEditor using the Editor Attribute on the
property, but that made no difference.

I just want the user to be able to selcect the image property in the
PropertyGrid and press delete to clear it.

Thanks

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
Nov 21 '05 #2

P: n/a
On Fri, 27 Aug 2004 07:08:19 +0100, Mick Doherty wrote:
<DefaultValue(GetType(Image), Nothing)>


Thanks, that did the trick!

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.