Property grid question, PLEASE HELP

  • Thread starter Thread starter developer___
  • Start date Start date
D

developer___

I have made my own control which inherits from UserControl. Within my
application i am using the propertygrid control to display my controls
properties, however i would like to remove properties like backcolor,
language, cursor, font etc. I know i can add the attribute
[Browsable(false)] but this can be added to properties u have made yourself,
the backcolor and cursor etc properties dont show up as they are inherited
so how can i remove them from showing up in the property grid? Thanks in
advance.
 
I have made my own control which inherits from UserControl. Within my
application i am using the propertygrid control to display my controls
properties, however i would like to remove properties like backcolor,
language, cursor, font etc. I know i can add the attribute
[Browsable(false)] but this can be added to properties u have made yourself,
the backcolor and cursor etc properties dont show up as they are inherited
so how can i remove them from showing up in the property grid? Thanks in
advance.

You can override the properties in the base class and then use the
[Browsable(false)] attribute. For example:

[Browsable(false)]
public override string Text
{
get { return base.Text; }
set { base.Text = value; }
}

Regards,
Kevin McNeish
..NET /C# MVP
Chief Software Architect, Mere Mortals .NET Framework
www.oakleafsd.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top