473,406 Members | 2,698 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,406 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.
Jul 21 '05 #1
2 2064
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
Jul 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.
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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: 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...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.