• Thread starter Alexander Vasilevsky
  • Start date


Alexander Vasilevsky

Made his UserControl, want to customize it using PropertyGrid, properties,
which must show it is my own, without the basic properties of the class. How
can I make a parent does not show properties? - Audio tools for C# and VB.Net developers



Bob Powell [MVP]

You can create a designer for your control and override the
PostFilterProperties method to remove the properties that you don't want to

See ControlDesigner and DesignerAttribute.

Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting

Find great Windows Forms articles in Windows Forms Tips and Tricks

Answer those GDI+ questions with the GDI+ FAQ

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


Hello Alexander,

The fact that you will need the parent properties at designtime (like
position, size, and so on) makes me think that this is at runtime that
you want to hide the parent properties of your custom control. Is it
the case? If yes, you have three possibilities:

- Derive your class from ICustomTypeDescriptor and implement
GetProperties to return only the properties you want.
- If you use .Net 2, you can set this functionaly in a separate class
and use TypeDescriptionProvider to register your TypeDescriptor.
- Create your own TypeConverter and implement GetProperties to return
only the properties you want. Attach this converter to your type with
the TypeConverterAttribute.

The Property Grid Resource List will list you the right resources to
implement one of these solutions.

You will be able to implement a generic way of filtering the parent
properties. The PropertyDescriptor class gives you the ComponentType
property so that you know the type of the target instance.
Type.IsAssignableFrom will tell you if your property belongs to your
custom control or to an ancestor type.

Best regards,

Nicolas Cadilhac @ VisualHint (
Home of Smart FieldPackEditor.Net / DateTimePicker replacement (http://
Home of Smart PropertyGrid for .Net and MFC (
Microsoft PropertyGrid Resource List -




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