Enables a Window to receive keyboard messages correctly when it is opened modelessly from Windows Forms.
Namespace:
System.Windows.Forms.Integration
Assembly:
WindowsFormsIntegration (in WindowsFormsIntegration.dll)
Visual Basic (Declaration)
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public Shared Sub EnableModelessKeyboardInterop ( _
window As Window _
)
Dim window As Window
ElementHost.EnableModelessKeyboardInterop(window)
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public static void EnableModelessKeyboardInterop(
Window window
)
[PermissionSetAttribute(SecurityAction::Demand, Name = L"FullTrust")]
public:
static void EnableModelessKeyboardInterop(
Window^ window
)
public static function EnableModelessKeyboardInterop(
window : Window
)
You cannot use methods in XAML.
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.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0
Reference
Other Resources