Control.SetTopLevel(Boolean) 方法

定義

將控制項設定為最上層控制項。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)

參數

value
Boolean

true 會將控制項設定為最上層控制項,否則為 falsetrue to set the control as the top-level control; otherwise, false.

例外狀況

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.

備註

如果您呼叫 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.

適用於

另請參閱