Click here to Skip to main content
15,898,792 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more: (untagged)
I know several ways to hide individual properties, and in something I'm working on I do it using a Designer, more specifically by overriding the PreFilterProperties method
<br />		protected override void PreFilterProperties(System.Collections.IDictionary properties)<br />		{<br />			properties.Remove("Dock");<br />			properties.Remove("TabStop");<br />			properties.Remove("TabIndex");<br />			properties.Remove("Visible");<br />			properties.Remove("Enabled");<br />			properties.Remove("Locked");  <===========================================================<br />			properties.Remove("Anchor");<br />			properties.Remove("Name");  <===========================================================<br />			properties.Remove("AutoSize");<br />			properties.Remove("AutoSizeMode");<br />			properties.Remove("Location");<br />			properties.Remove("Size");<br />			properties.Remove("MaximumSize");<br />			properties.Remove("MinimumSize");<br />			properties.Remove("BorderStyle");<br />			properties.Remove("GenerateMember");<br />			properties.Remove("Modifiers");<br />			properties.Remove("Design");<br /><br />			base.PreFilterProperties(properties);<br />		}<br />


The two properties marked still show up however. [confused]

They are both in the 'Design' Category, so even if the code above worked, I would still be left with an empty Category. So

1) anybody got any ideas about why the two properties remain and/or how to get rid of them.
2) any ideas on how to remove the 'Design' Category. If you look at either of the Panels in a SplitContainer, they don't have a Design Category, so presumably it is possible.

Posted

1 solution

Hello Sir Henry,

my undercover informant told me the secret of SplitContainer panels is in this line:
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

Hope that helps.

:)

 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900