WindowsFormsHost.EnableWindowsFormsInterop WindowsFormsHost.EnableWindowsFormsInterop WindowsFormsHost.EnableWindowsFormsInterop WindowsFormsHost.EnableWindowsFormsInterop Method

定義

從 WPF 以非強制回應的方式開啟 Form 時,讓它可以正確運作。Enables a Form to function correctly when it is opened modelessly from WPF.

public:
 static void EnableWindowsFormsInterop();
public static void EnableWindowsFormsInterop ();
static member EnableWindowsFormsInterop : unit -> unit
Public Shared Sub EnableWindowsFormsInterop ()

備註

呼叫EnableWindowsFormsInterop方法,以轉送所有鍵盤訊息System.Windows.Forms.Formmodelessly 開啟。Call the EnableWindowsFormsInterop method to forward all keyboard messages when a System.Windows.Forms.Form is opened modelessly. EnableWindowsFormsInterop方法,會安裝 「 訊息篩選條件所需的非強制回應表單開啟 WPF 時正確運作。The EnableWindowsFormsInterop method installs a message filter that is required for modeless forms to function correctly when opened by WPF. 您必須呼叫這個方法一次特定WindowsFormsHost執行個體。You need to call this method only once for a particular WindowsFormsHost instance.

安全性

Demand
如需呼叫堆疊中較高的所有呼叫端的完全信任。for full trust for all callers higher in the call stack. 這個成員無法供部分信任的程式碼使用。This member cannot be used by partially trusted code.

適用於

另請參閱