RadVirtualKeyboard
Represents a virtual keyboard control that provides on-screen input capabilities for user interaction. This control allows users to input text and commands without requiring a physical keyboard, making it ideal for touch-enabled applications and accessibility scenarios.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadVirtualKeyboard : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadVirtualKeyboard...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadVirtualKeyboard class with default settings. The keyboard is created as non-focusable and non-tab-stop to prevent interference with the target input controls.
public RadVirtualKeyboard()
Properties
Gets the default size of the virtual keyboard control. This size provides optimal dimensions for displaying a complete keyboard layout.
protected override Size DefaultSize { get; }
Overrides:
Gets or sets the keyboard layout type that determines the arrangement and types of keys displayed. Changing this value automatically updates the MainLayoutPanel property with a predefined layout configuration.
public KeyboardLayoutType LayoutType { get; set; }
Gets or sets the main layout panel that hosts and arranges keyboard layouts and their key elements. This panel determines the overall structure and organization of the virtual keyboard interface.
public VirtualKeyboardLayoutPanel MainLayoutPanel { get; set; }
Gets or sets a value indicating whether the font size should automatically scale when the control size changes. When enabled, key text remains proportional to the keyboard size, ensuring optimal readability at different scales.
public bool ScaleFontOnResize { get; set; }
Gets or sets a value indicating whether the keyboard should automatically synchronize with system language changes. When enabled, the keyboard layout will update automatically when the system input language is changed.
public bool SynchronizeCultureWithSystem { get; set; }
Gets or sets a value indicating whether to play an audible sound when keys are pressed. This provides audio feedback to enhance the user experience during keyboard interaction.
public bool UseClickSound { get; set; }
Gets the RadVirtualKeyboardElement instance that contains the core keyboard functionality. This element manages all keyboard operations, layout, and visual appearance.
public RadVirtualKeyboardElement VirtualKeyboardElement { get; }
Gets or sets the serialization configuration used by layout save and load operations. When set to null, the default serialization configuration from GetDefaultXmlSerializationInfo() is used. This property controls which properties and objects are included in the XML serialization process.
[Browsable(false)]
public ComponentXmlSerializationInfo XmlSerializationInfo { get; set; }
Methods
Calculates the optimal size for the RadVirtualKeyboard based on the current layout configuration. The calculation considers key dimensions, layout structure, padding, and DPI scaling to provide the ideal control size.
Determines whether the specified element should be visible in the design-time element hierarchy editor. This method controls which elements appear in the Edit UI Elements dialog during design time.
protected override bool CanEditElementAtDesignTime(RadElement element)
The RadElement to evaluate for design-time visibility.
Returns:True if the element should be visible in the element editor; otherwise, false.
Overrides:
Creates an accessibility object that provides support for UI automation and assistive technologies. Returns a specialized accessibility object when EnableRadAccessibilityObjects is enabled.
protected override AccessibleObject CreateAccessibilityInstance()
An AccessibleObject that provides accessibility support for the virtual keyboard.
Overrides:
Creates the main RadVirtualKeyboardElement that contains all keyboard functionality and UI elements. This method can be overridden in derived classes to provide custom keyboard element implementations.
protected virtual RadVirtualKeyboardElement CreateKeyboardElement()
A new instance of RadVirtualKeyboardElement that serves as the core keyboard component.
Creates and returns the default XML serialization configuration for the RadVirtualKeyboard control. This configuration defines which properties should be serialized, hidden, or treated as content during save/load operations.
protected virtual ComponentXmlSerializationInfo GetDefaultXmlSerializationInfo()
A ComponentXmlSerializationInfo object containing the default serialization rules.
Loads keyboard layout configuration from an XML file at the specified path. If the file does not exist, an error message is displayed to the user.
public virtual void LoadLayout(string fileName)
The full path to the XML file containing the saved layout configuration.
Loads keyboard layout configuration from XML data using the specified XML reader. If an error occurs during loading, an error message is displayed to the user.
Serializes the current keyboard layout configuration to XML format and writes it to the specified stream. The stream remains open after the operation completes, allowing for additional operations.
Serializes the current keyboard layout configuration to an XML file at the specified path. The file will be created or overwritten with the current layout data in a formatted XML structure.
public virtual void SaveLayout(string fileName)
The full path to the file where the layout data will be saved.
Serializes the current keyboard layout configuration to XML format using the specified XML writer. The layout data includes key arrangements, properties, and customizations that can be restored later.
Events
Occurs when a key is about to be sent to the target input control. This event allows for cancellation and modification of key sending operations before they are processed.
public event VirtualKeyboardKeySendingEventHandler KeySending
Occurs after a key has been successfully sent to the target input control. This event provides notification that a key operation has been completed.
public event VirtualKeyboardKeySentEventHandler KeySent