.NET Framework Class Library
ElementHost..::.EnableModelessKeyboardInterop Method

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)
Syntax

Visual Basic (Declaration)
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public Shared Sub EnableModelessKeyboardInterop ( _
    window As Window _
)
Visual Basic (Usage)
Dim window As Window

ElementHost.EnableModelessKeyboardInterop(window)
C#
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public static void EnableModelessKeyboardInterop(
    Window window
)
Visual C++
[PermissionSetAttribute(SecurityAction::Demand, Name = L"FullTrust")]
public:
static void EnableModelessKeyboardInterop(
    Window^ window
)
JScript
public static function EnableModelessKeyboardInterop(
    window : Window
)
XAML
You cannot use methods in XAML.

Parameters

window
Type: System.Windows..::.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.

.NET Framework Security

Platforms

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.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Other Resources

Tags :


Page view tracker