Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to change the ComponentModel.Category for an existing property without changing anything else?

Posted on 2008-10-24
4
Medium Priority
?
272 Views
Last Modified: 2012-05-05
Hello,

I know one can use the ComponentModel.Category to set a category for a custom property. But how do I change the category for an existing propery without changing anything else of that property?

example: I want to change the property 'Enabled' from Behavior to Appearance.

How do I accomplish this?

Thank you!
0
Comment
Question by:Onthrax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22803080
I don't know why you would want to do that, but you might be able to create a custom class, and inherit from a class, and then override the property, but use the base implementation, and add the attribute that you wish to use.
0
 
LVL 13

Author Comment

by:Onthrax
ID: 22948259
How does one add base implementation to a property when overriding the property?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 22949463
Simple example:


public class ListControl : ListBox
{
 
    [Category("Appearance")]
    public override bool Enabled
    {
        get { return base.Enabled; }
        set { base.Enabled = value; }
    }
}

Open in new window

0
 
LVL 13

Author Comment

by:Onthrax
ID: 22983322
Working like a charm! Cheers m8!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question