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

Posted on 2008-10-24
Medium Priority
Last Modified: 2012-05-05

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!
Question by:Onthrax
  • 2
  • 2
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.
LVL 13

Author Comment

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

Accepted Solution

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

public class ListControl : ListBox
    public override bool Enabled
        get { return base.Enabled; }
        set { base.Enabled = value; }

Open in new window

LVL 13

Author Comment

ID: 22983322
Working like a charm! Cheers m8!

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …

627 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