TypeDescriptor.GetComponentName メソッド

定義

指定したコンポーネントの名前を返します。

オーバーロード

名前 説明
GetComponentName(Object)

既定の型記述子を使用して、指定したコンポーネントの名前を返します。

GetComponentName(Object, Boolean)

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

GetComponentName(Object)

既定の型記述子を使用して、指定したコンポーネントの名前を返します。

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

パラメーター

component
Object

クラス名を指定する Object

返品

指定したコンポーネントの名前を含む String 。コンポーネント名がない場合は null

例外

componentnullです。

component は、プロセス間のリモート オブジェクトです。

注釈

通常、このメソッドはコンポーネントのサイトの名前 (存在する場合) を返します。 たとえば、ボタンのクラス名は "System.Windows。Forms.Button"。

このメソッドは、false の 2 番目のパラメーターを持つオーバーロードされたGetComponentName(Object, Boolean) メソッドと同じです。

このメソッドは、デザイン時にコンポーネントのインスタンスの名前を取得するために使用されます。

こちらもご覧ください

適用対象

GetComponentName(Object, Boolean)

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

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

パラメーター

component
Object

クラス名を指定する Object

noCustomTypeDesc
Boolean

true カスタム型の説明情報を考慮しない場合。それ以外の場合は false

返品

指定したコンポーネントのクラスの名前。コンポーネント名がない場合は null

例外

componentnullです。

component は、プロセス間のリモート オブジェクトです。

注釈

このメソッドは、デザイン時にコンポーネントのインスタンスの名前を取得するために使用されます。 通常、このメソッドはコンポーネントのサイトの名前 (存在する場合) を返します。 たとえば、ボタンのクラス名は "System.Windows。Forms.Button"。 コンポーネントが ICustomTypeDescriptor インターフェイスを実装している場合は、代替名を返すことができます。

こちらもご覧ください

適用対象