Property Grid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Is there any way to stop some properties of the parent classes from
appearing in the propertygrid?

Thanks
Rohan Ranade
 
Will using BrowsableAttribute be of any help?

Hi

Is there any way to stop some properties of the parent classes from
appearing in the propertygrid?

Thanks
Rohan Ranade
 
Sure, you would need to write a designer class to do it.
Let's see...

You would create a designer class like so:
using System;

using System.Windows.Forms.ComponentModel;

using System.Windows.Forms.Design;

namespace MyDerivedCtrlProjectNameSpace

{

public class MyDerivedCtrlDesigner : ControlDesigner

{

// If you want to remove properties from designer, you overrid
PostFilterProperties

protected override void PostFilterProperties(System.Collections.IDictionary
properties)

{

properties.Remove("AccessibleDescription");

properties.Remove("AccessibleName");

properties.Remove("AccessibleRole");

}

Then you would link the designer class to the control, like so:
namespace MyDerivedCtrlProjectNamespace

{

[Designer(typeof(MyDerivedCtrlDesigner))]

public class MyDerivedControl : System.Windows.Forms.<whatever>

{

// control definition here

}

}



For more info, look at the help for "ControlDesigner".

--Rachel
 

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