Component.ToString 方法

定义

返回包含 String 的名称的 Component(如果有)。Returns a String containing the name of the Component, if any. 不应重写此方法。This method should not be overridden.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

返回

包含 String 的名称的 Component(如果有);如果 null 未命名,则为 ComponentA String containing the name of the Component, if any, or null if the Component is unnamed.

注解

Component 可以为,也可以不具有名称。A Component may or may not have a name. 如果为 Component 提供了名称,则该名称在其 IContainer中的其他 Component 对象中是唯一的。If a Component is given a name, the name is unique among other Component objects within its IContainer.

ISite 存储 Component的名称。The ISite stores the name of the Component. 如果 Component 已添加到 IContainer,并且 IContainer 向其分配了 ISite,则只能具有 ISiteA Component can only have an ISite if it has been added to an IContainer and the IContainer assigns an ISite to it.

适用于

另请参阅