Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Hide controls for propertygrid in Property Window
 

Hide controls for propertygrid in Property Window

Hi,

I'm creating a baseform for my application with following property:

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Control FormContainer
{
get
{
return _FormContainer;
}
set
{
_FormContainer = value;
}
}

When I create a form derived from my baseform I see the FormContainer property in the propertygrid of the property window, as it should be.
But when I click on the combobox of that property to select a value, I see all the controls of my baseform, even the private ones. I even see them in the combox (just above the toolstrip with categorized,...) on top of the property window.

Is there a way to hide the private controls for the propertygrid, so that inheritors can not select them?

Thanks in advance

Kind Regards

Frederik
Frederik Vanderhaegen  Wednesday, February 06, 2008 10:57 AM

You can implement a custom type converter and apply it to your FormContainer property. You can fill the dropdown on your own by providing your own implementation of GetStandardValues.

HTH, Alex

Alex80  Tuesday, February 12, 2008 5:39 PM

Hi Frederik,

Since this is a Winform design-time specific issue, I will move this thread to the best match forum to get better help. Thanks.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Jeffrey Tan - MSFT  Friday, February 08, 2008 9:06 AM

You can implement a custom type converter and apply it to your FormContainer property. You can fill the dropdown on your own by providing your own implementation of GetStandardValues.

HTH, Alex

Alex80  Tuesday, February 12, 2008 5:39 PM

You can use google to search for other answers

Custom Search

More Threads

• How to change disabled textbox fonts color ?
• Name Property
• How do I set the color of an InputBox scrollbar
• how to debug a control as it's loaded into control/resource/forms editor
• Collection edior
• Convert LINQ resultset to Datatable in C#
• Available Colors Property in Designer
• PropertyGrid & CollectionEditor change events
• How can I make a form listen to mouse_move event at design-time?
• Readonly textbox - change forecolor