次の方法で共有


TypeDescriptor.GetClassName メソッド (Object, Boolean)

カスタムの型記述子を使用して、指定したコンポーネントのクラスの名前を取得します。

Overloads Public Shared Function GetClassName( _
   ByVal component As Object, _   ByVal noCustomTypeDesc As Boolean _) As String
[C#]
public static string GetClassName(objectcomponent,boolnoCustomTypeDesc);
[C++]
public: static String* GetClassName(Object* component,boolnoCustomTypeDesc);
[JScript]
public static function GetClassName(
   component : Object,noCustomTypeDesc : Boolean) : String;

パラメータ

  • component
    クラス名を取得する対象の Object
  • noCustomTypeDesc
    ICustomTypeDescriptor のインスタンスが TypeDescriptor を呼び出す場合は true 。それ以外の場合は false

戻り値

指定したコンポーネントのクラスの名前。

例外

例外の種類 条件
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 | ICustomTypeDescriptor