Click here to Skip to main content
15,887,875 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hello all,
i have created a Windows Forms Control Library project.In Windows Forms Control Library Project, there are so many Predefine properties.and it has also Some other properties also(define by me).i want to hide Predefine properties when i display in Propertygrid. how can i do this.i need your Help....
Posted

C#
[Browsable(false)]
public override string Text
{
    get { return base.Text; }
    set { base.Text = value; }
}
 
Share this answer
 
Use the Browsable attribute on the properties you want to hide

C#
[Browsable(false)]
public int MyProperty {
get {
.......

VB
<Browsable(False)> _
Public Property MyProperty() As Integer
Get ......
 
Share this answer
 
Comments
Jitendra_rtpl 11-Nov-10 0:59am    
but how to use this Attribute on predefine properties of control.
strogg 11-Nov-10 15:41pm    
You cannot. If you want to, you must inherit from the class, filter and expose whatever properties you want.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



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