Control.SetTopLevel(Boolean) Method

Definition

将控件设置为顶级控件。Sets the control as the top-level control.

protected:
 void SetTopLevel(bool value);
protected void SetTopLevel (bool value);
member this.SetTopLevel : bool -> unit
Protected Sub SetTopLevel (value As Boolean)

Parameters

value
Boolean

true 表示将控件设置为顶级控件;false 表示不作此设置。true to set the control as the top-level control; otherwise, false.

Exceptions

value 参数被设置为 true 且控件是 ActiveX 控件。The value parameter is set to true and the control is an ActiveX control.

GetTopLevel() 返回值不等于 value 参数且 Parent 属性不为 nullThe GetTopLevel() return value is not equal to the value parameter and the Parent property is not null.

Remarks

如果调用了 FormSetTopLevel 方法并传入了 false的值,则在再次调用 SetTopLevel 之前,该窗体将不可见,并传入 true的值。If you call the SetTopLevel method of a Form and pass in a value of false, the form will not be visible until you call SetTopLevel again, passing in a value of true.

Applies to

See also