We have released version 5.2 of WinForms Virtual Keyboard control. It contains the following new features and improvements:
Automatic popup extenderThe new VirtualKeyboardExtender component provides declarative virtual keyboard auto-show capabilities for Windows Forms applications. When added to a form, it implements IExtenderProvider to expose design-time properties on all input controls, enabling the virtual keyboard to automatically pop up on focus and hide when focus leaves:
- AutoShow – enables or disables automatic popup display for the target control (or for all child controls when set on the Form).
- LayoutMode – specifies the keyboard layout (Default, Extended, Compact, Numeric3x4, or Numeric4x4) associated with the focused control.
- PopupPlacement – defines the popup position relative to the control (Bottom, Top, Left, Right, FormBottom, or ScreenBottom).
- CustomLayout – allows assigning a custom KeyboardLayout template to specific fields.
The popup uses a non-activating tool window style, ensuring that interaction with the virtual keyboard never steals focus from the active text box. Both physical and on-screen keyboard inputs work simultaneously without focus interruptions.
// Enable automatic popup for all input fields on the form
virtualKeyboardExtender.SetAutoShow(this, true);
virtualKeyboardExtender.SetLayoutMode(this, KeyboardMode.Compact);
// Assign specialized numeric layouts to specific fields
virtualKeyboardExtender.SetLayoutMode(txtUserID, KeyboardMode.Numeric3x4);
virtualKeyboardExtender.SetLayoutMode(txtPhone, KeyboardMode.Numeric4x4);
New standard layoutsThree new built-in keyboard layouts have been added to the KeyboardMode enumeration and can be activated via the Mode property or retrieved as reusable KeyboardLayout templates:
- Compact – a streamlined layout without function keys (F1–F12) or redundant modifiers, ideal for mobile, touch, and compact popup windows.
- Numeric3x4 – a 3×4 telephone-style numeric keypad with 0–9 digits, Backspace, and Clear (C).
- Numeric4x4 – a 4×4 numeric keypad including 0–9, decimal point, minus sign, Backspace, Clear, Tab, and Enter.
// Select a layout mode directly or retrieve preconfigured layout objects
virtualKeyboard.Mode = KeyboardMode.Compact;
// Or use static factory methods for LayoutRing or TemplateLayout
var layout = KeyboardLayout.CompactLayout();
...
Miscellaneous- Added ClearKey class and static Clear property to clear the contents of currently focused input controls.
- Added ForceUpdateLayout method to VirtualKeyboard.
- Automatic password detection: the auto-show popup automatically enables PasswordMode when the target field is a password box.
The latest version can be downloaded here, or from the
clients area on our site:
https://mindfusion.dev/KeyboardWinForms.zipUpdated assemblies are also available as
MindFusion.Keyboard NuGet package.
Enjoy!