.NET Framework Class Library
EditorBrowsableAttribute Class

Specifies that a property or method is viewable in an editor. This class cannot be inherited.

Inheritance Hierarchy
SystemObject
   SystemAttribute
    System.ComponentModelEditorBrowsableAttribute

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)
Syntax
<[%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_0%]([%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_1%].Class Or [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_2%].Struct Or [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_3%].Enum Or [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_4%].Constructor Or [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_5%].Method Or [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_6%].Property Or [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_7%].Field Or [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_8%].Event Or [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_9%].Interface Or [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_10%].Delegate)> _
Public NotInheritable Class EditorBrowsableAttribute _
	Inherits [%$TOPIC/8a045wyx_en-us_VS_110_2_0_0_0_11%]
[[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_0%]([%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_1%].Class|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_2%].Struct|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_3%].Enum|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_4%].Constructor|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_5%].Method|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_6%].Property|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_7%].Field|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_8%].Event|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_9%].Interface|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_10%].Delegate)]
public sealed class EditorBrowsableAttribute : [%$TOPIC/8a045wyx_en-us_VS_110_2_0_1_0_11%]
[[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_0%]([%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_1%]::Class|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_2%]::Struct|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_3%]::Enum|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_4%]::Constructor|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_5%]::Method|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_6%]::Property|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_7%]::Field|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_8%]::Event|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_9%]::Interface|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_10%]::Delegate)]
public ref class EditorBrowsableAttribute sealed : public [%$TOPIC/8a045wyx_en-us_VS_110_2_0_2_0_11%]
[<[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_0%]>]
[<[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_1%]([%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_2%].Class|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_3%].Struct|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_4%].Enum|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_5%].Constructor|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_6%].Method|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_7%].Property|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_8%].Field|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_9%].Event|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_10%].Interface|[%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_11%].Delegate)>]
type EditorBrowsableAttribute =  
    class 
        inherit [%$TOPIC/8a045wyx_en-us_VS_110_2_0_3_0_12%] 
    end

The EditorBrowsableAttribute type exposes the following members.

Constructors
  NameDescription
Public method Supported by the XNA Framework EditorBrowsableAttributeInitializes a new instance of the EditorBrowsableAttribute class with State set to the default state.
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps EditorBrowsableAttribute(EditorBrowsableState)Initializes a new instance of the EditorBrowsableAttribute class with an EditorBrowsableState.
Top
Properties
  NameDescription
Public property Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps StateGets the browsable state of the property or method.
Public property TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute.)
Top
Methods
  NameDescription
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps EqualsReturns whether the value of the given object is equal to the current EditorBrowsableAttribute. (Overrides AttributeEquals(Object).)
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps GetHashCodeReturns the hash code for this instance. (Overrides AttributeGetHashCode.)
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps GetTypeGets the Type of the current instance. (Inherited from Object.)
Public method IsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute.)
Public method Supported by the XNA Framework MatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.)
Public method Supported by the XNA Framework Supported by Portable Class Library Supported in .NET for Windows Store apps ToStringReturns a string that represents the current object. (Inherited from Object.)
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implemetation Private method _AttributeGetIDsOfNamesMaps a set of names to a corresponding set of dispatch identifiers. (Inherited from Attribute.)
Explicit interface implemetation Private method _AttributeGetTypeInfoRetrieves the type information for an object, which can be used to get the type information for an interface. (Inherited from Attribute.)
Explicit interface implemetation Private method _AttributeGetTypeInfoCountRetrieves the number of type information interfaces that an object provides (either 0 or 1). (Inherited from Attribute.)
Explicit interface implemetation Private method _AttributeInvokeProvides access to properties and methods exposed by an object. (Inherited from Attribute.)
Top
Remarks

EditorBrowsableAttribute is a hint to a designer indicating whether a property or method is to be displayed. You can use this type in a visual designer or text editor to determine what is visible to the user. For example, the IntelliSense engine in Visual Studio uses this attribute to determine whether to show a property or method.

In Visual C#, you can control when advanced properties appear in IntelliSense and the Properties Window with the Hide Advanced Members setting under Tools | Options | Text Editor | C#. The corresponding EditorBrowsableState is Advanced.

NoteNote

In Visual C#, EditorBrowsableAttribute does not suppress members from a class in the same assembly.

Examples

The following sample demonstrates how to hide a property of a class from IntelliSense by setting the appropriate value for the EditorBrowsableAttribute attribute. Build Class1 in its own assembly.

In Visual Studio, create a new Windows Application solution, and add a reference to the assembly which contains Class1. In the Form1 constructor, declare an instance of Class1, type the name of the instance, and press the period key to activate the IntelliSense drop-down list of Class1 members. The Age property does not appear in the drop-down list.

Imports System.ComponentModel

Public Class Class1

    Private ageval As Integer

    <EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)> _
    Public Property Age() As Integer 

        Get 
            Return ageval
        End Get 

        Set(ByVal Value As Integer)
            If Not ageval.Equals(Value) Then
                ageval = Value
            End If 
        End Set 

    End Property 

End Class
using System;
using System.ComponentModel;

namespace EditorBrowsableDemo
{
    public class Class1
    {
        public Class1()
        {
            // 
            // TODO: Add constructor logic here 
            //
        }

        int ageval;

        [EditorBrowsable(EditorBrowsableState.Never)]
        public int Age
        {
            get { return ageval; }
            set
            {
                if (!ageval.Equals(value))
                {
                    ageval = value;
                }
            }
        }
    }
}
#using <system.dll>

using namespace System;
using namespace System::ComponentModel;

namespace EditorBrowsableDemo
{
   public ref class Class1
   {
   public:
      Class1()
      { 
         // 
         // TODO: Add constructor logic here 
         //
      }

   private:
      int ageval;

   public:
      [EditorBrowsable(EditorBrowsableState::Never)]
      property int Age 
      {
         int get()
         {
            return ageval;
         }

         void set( int value )
         {
            if ( ageval != value )
            {
               ageval = value;
            }
         }
      }
   };
}
Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Platforms

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.