TypeDescriptor.GetComponentName TypeDescriptor.GetComponentName TypeDescriptor.GetComponentName TypeDescriptor.GetComponentName Method

Definition

Returns the name of the specified component.

Overloads

GetComponentName(Object) GetComponentName(Object) GetComponentName(Object) GetComponentName(Object)

Returns the name of the specified component using the default type descriptor.

GetComponentName(Object, Boolean) GetComponentName(Object, Boolean) GetComponentName(Object, Boolean) GetComponentName(Object, Boolean)

Returns the name of the specified component using a custom type descriptor.

GetComponentName(Object) GetComponentName(Object) GetComponentName(Object) GetComponentName(Object)

Returns the name of the specified component using the default type descriptor.

public:
 static System::String ^ GetComponentName(System::Object ^ component);
public static string GetComponentName (object component);
static member GetComponentName : obj -> string
Public Shared Function GetComponentName (component As Object) As String

Parameters

component
Object Object Object Object

The Object for which you want the class name.

Returns

A String containing the name of the specified component, or null if there is no component name.

Exceptions

Remarks

Typically, this method returns the name for the site of the component, if one exists. For example, the class name for a button is "System.Windows.Forms.Button".

This method is equivalent to the overloaded GetComponentName(Object, Boolean) method with a second parameter of false.

This method is used at design time to retrieve the name of an instance of a component.

See Also

GetComponentName(Object, Boolean) GetComponentName(Object, Boolean) GetComponentName(Object, Boolean) GetComponentName(Object, Boolean)

Returns the name of the specified component using a custom type descriptor.

public:
 static System::String ^ GetComponentName(System::Object ^ component, bool noCustomTypeDesc);
public static string GetComponentName (object component, bool noCustomTypeDesc);
static member GetComponentName : obj * bool -> string
Public Shared Function GetComponentName (component As Object, noCustomTypeDesc As Boolean) As String

Parameters

component
Object Object Object Object

The Object for which you want the class name.

noCustomTypeDesc
Boolean Boolean Boolean Boolean

true to consider custom type description information; otherwise, false.

Returns

The name of the class for the specified component, or null if there is no component name.

Exceptions

Remarks

This method is used at design time to retrieve the name of an instance of a component. Typically, this method returns the name for the site of the component, if one exists. For example, the class name for a button is "System.Windows.Forms.Button". If the component implements the ICustomTypeDescriptor interface, it can return an alternate name.

See Also

Applies to