Tech Off Post

Single Post Permalink

View Thread: How do you hide properties?
  • User profile image

    ktr said:

    using System.Windows.Forms; using System.ComponentModel; namespace Test2 { class ProgressBar2 : ProgressBar { [Browsable(false)] [EditorBrowsable(EditorBrowsableState.Never)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
     public new bool TabStop { get { return ((Control)this).TabStop; } set { ((Control)this).TabStop = value; } } } } 

    Also, this won't hide the property from intellisense unless the project you are working on lives in a different DLL from the control.  You also can't have the project that the control lives in open in the same VS instance, otherwise intellisense will pick it up.