Form.Show(IWin32Window) Form.Show(IWin32Window) Form.Show(IWin32Window) Form.Show(IWin32Window) Method

定義

為使用者顯示具有指定擁有人的表單。Shows the form with the specified owner to the user.

public:
 void Show(System::Windows::Forms::IWin32Window ^ owner);
public void Show (System.Windows.Forms.IWin32Window owner);
override this.Show : System.Windows.Forms.IWin32Window -> unit
Public Sub Show (owner As IWin32Window)

參數

owner
IWin32Window IWin32Window IWin32Window IWin32Window

實作 IWin32Window 及代表將擁有這個表單之最上層視窗的任何物件。Any object that implements IWin32Window and represents the top-level window that will own this form.

例外狀況

已經可以看到所顯示的表單。The form being shown is already visible.

-或--or- owner 參數中指定的表單與顯示的表單相同。The form specified in the owner parameter is the same as the form being shown.

-或--or- 已停用所顯示的表單。The form being shown is disabled.

-或--or- 所顯示的表單不是最上層視窗。The form being shown is not a top-level window.

-或--or- 顯示為對話方塊的表單已是強制回應表單。The form being shown as a dialog box is already a modal form.

-或--or- 目前的處理序不在使用者互動模式下執行 (如需詳細資訊,請參閱 UserInteractive)。The current process is not running in user interactive mode (for more information, see UserInteractive).

備註

您可以使用這個方法來顯示非強制回應表單。You can use this method to display a non-modal form. 當您使用這個方法時, Owner表單的屬性會設定為ownerWhen you use this method, the Owner property of the form is set to owner. 非強制回應表單可以使用Owner屬性來取得主控表單的相關資訊。The non-modal form can use the Owner property to get information about the owning form. 呼叫這個方法等同于設定Owner非模式的屬性,然後Show()呼叫方法。Calling this method is identical to setting the Owner property of the non-modal and then calling the Show() method.

顯示表單相當於將Visible屬性設定為。 trueShowing the form is equivalent to setting the Visible property to true. 呼叫方法之後Visible Hidetrue屬性會傳回的值,直到呼叫方法為止。 ShowAfter the Show method is called, the Visible property returns a value of true until the Hide method is called.

適用於

另請參閱