473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Image Property on PropertyGrid

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
2 4324
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Dunaway | last post by:
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...
0
by: Mevar81 | last post by:
Hi to all.I have a big problem.I have a propertygrid im my application to configure some control.I want to change runtime the image of a control and store the name of the file that holds the image...
7
by: siddhiash | last post by:
Hi Friends I want to add PasswordChar Property which shows ****** for string which I type in PropertyGrid Control. Regards, Siddharth
2
by: Lance | last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property....
5
by: Ger | last post by:
The propertygrid is a great control, but I would like to show a more descriptive text for the properties in the control. I tried to find a solution within the system.componentmodel but did not...
5
by: Diomatas | last post by:
Hi I ve got a class with some public properties and one of them is of type image. I use these properties in a propertygrid. When the user press the little button into the propertygrid, an open...
1
by: John Kraft | last post by:
Hi all, I'm trying to use a property grid, and what I'm trying to do seems to really elude me. I've been using the property grid for a short period of time, and this is the first thing I...
2
by: Robbe Morris - [MVP] C# | last post by:
I've never had to do this before... I have a web app that needs to look for image files outside the web site folders if it is run on localhost but look for the image files in sub folders of the...
1
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property...
10
by: Derek Hart | last post by:
I can set focus to my property grid by using propgrid.Focus - but how can I set the default property that is always first? Or just set focus to the default property? Can this be done?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.