TypeDescriptor.GetComponentName Method (Object)

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

Namespace: System.ComponentModel
Assembly: System (in system.dll)

public static string GetComponentName (
	Object component
public static String GetComponentName (
	Object component
public static function GetComponentName (
	component : Object
) : String
Not applicable.



The Object for which you want the class name.

Return Value

A String containing the name of the specified component, or a null reference (Nothing in Visual Basic) if there is no component name.

Exception typeCondition


component is a null reference (Nothing in Visual Basic).


component is a cross-process remoted object.

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.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0