ElementHost.EnableModelessKeyboardInterop(Window) Method

Definition

Enables a Window to receive keyboard messages correctly when it is opened modelessly from Windows Forms.

C#
public static void EnableModelessKeyboardInterop(System.Windows.Window window);

Parameters

window
Window

The Windows Presentation Foundation (WPF) window to be opened modelessly.

Remarks

Call the EnableModelessKeyboardInterop method to forward all keyboard messages when a WPF window is opened modelessly. The EnableModelessKeyboardInterop method installs a message filter in the Windows Forms-based application. The filter forwards all keyboard messages when the modeless window is active.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also