.NET Framework Class Library
KeyInterop..::.VirtualKeyFromKey Method

Converts a WPF Key into a Win32 Virtual-Key.

Namespace:  System.Windows.Input
Assembly:  WindowsBase (in WindowsBase.dll)
Syntax

Visual Basic (Declaration)
Public Shared Function VirtualKeyFromKey ( _
    key As Key _
) As Integer
Visual Basic (Usage)
Dim key As Key
Dim returnValue As Integer

returnValue = KeyInterop.VirtualKeyFromKey(key)
C#
public static int VirtualKeyFromKey(
    Key key
)
Visual C++
public:
static int VirtualKeyFromKey(
    Key key
)
JScript
public static function VirtualKeyFromKey(
    key : Key
) : int
XAML
You cannot use methods in XAML.

Parameters

key
Type: System.Windows.Input..::.Key
The WPF to convert.

Return Value

Type: System..::.Int32
The Win32 Virtual-Key.
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

Tags :


Page view tracker