既定の型記述子を使用して、指定したコンポーネントのクラスの名前を取得します。
Overloads Public Shared Function GetClassName( _
ByVal component As Object _) As String
[C#]
public static string GetClassName(objectcomponent);
[C++]
public: static String* GetClassName(Object* component);
[JScript]
public static function GetClassName(
component : Object) : String;
パラメータ
- component
クラス名を取得する対象の Object 。
戻り値
指定したコンポーネントのクラスの名前。
例外
例外の種類 | 条件 |
---|---|
ArgumentNullException | component パラメータが null 参照 (Visual Basic では Nothing) です。 |
解説
通常、このメソッドは、component パラメータに指定したオブジェクトの Type の完全型名を返します。component パラメータが ICustomTypeDescriptor を実装している場合、代替の名前を返す場合があります。
たとえば、ボタンのクラス名は System.Windows.Forms.Button です。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
TypeDescriptor クラス | TypeDescriptor メンバ | System.ComponentModel 名前空間 | TypeDescriptor.GetClassName オーバーロードの一覧 | TypeDescriptor | EventDescriptor | PropertyDescriptor