ClassRadVirtualKeyboard
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
RadVirtualKeyboard()
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.
Declaration
public RadVirtualKeyboard()
Properties
DefaultSize
Gets the default size of the virtual keyboard control. This size provides optimal dimensions for displaying a complete keyboard layout.
Declaration
protected override Size DefaultSize { get; }
Property Value
Overrides
LayoutType
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.
Declaration
public KeyboardLayoutType LayoutType { get; set; }
Property Value
MainLayoutPanel
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.
Declaration
public VirtualKeyboardLayoutPanel MainLayoutPanel { get; set; }
Property Value
ScaleFontOnResize
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.
SynchronizeCultureWithSystem
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.
Declaration
public bool SynchronizeCultureWithSystem { get; set; }
Property Value
UseClickSound
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.
VirtualKeyboardElement
Gets the RadVirtualKeyboardElement instance that contains the core keyboard functionality. This element manages all keyboard operations, layout, and visual appearance.
Declaration
public RadVirtualKeyboardElement VirtualKeyboardElement { get; }
Property Value
XmlSerializationInfo
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.
Declaration
[Browsable(false)]
public ComponentXmlSerializationInfo XmlSerializationInfo { get; set; }
Property Value
Methods
CalculateDesiredSize()
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.
CanEditElementAtDesignTime(RadElement)
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.
Declaration
protected override bool CanEditElementAtDesignTime(RadElement element)
Parameters
element
The RadElement to evaluate for design-time visibility.
Returns
True if the element should be visible in the element editor; otherwise, false.
Overrides
CreateAccessibilityInstance()
Creates an accessibility object that provides support for UI automation and assistive technologies. Returns a specialized accessibility object when EnableRadAccessibilityObjects is enabled.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
An AccessibleObject that provides accessibility support for the virtual keyboard.
Overrides
CreateKeyboardElement()
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.
Declaration
protected virtual RadVirtualKeyboardElement CreateKeyboardElement()
Returns
A new instance of RadVirtualKeyboardElement that serves as the core keyboard component.
GetDefaultXmlSerializationInfo()
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.
Declaration
protected virtual ComponentXmlSerializationInfo GetDefaultXmlSerializationInfo()
Returns
A ComponentXmlSerializationInfo object containing the default serialization rules.
LoadLayout(Stream)
Loads keyboard layout configuration from XML data in the specified stream. The stream position is reset to the beginning if it is currently at the end.
LoadLayout(XmlReader)
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.
LoadLayout(string)
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.
Declaration
public virtual void LoadLayout(string fileName)
Parameters
fileName
The full path to the XML file containing the saved layout configuration.
SaveLayout(Stream)
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.
SaveLayout(XmlWriter)
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.
SaveLayout(string)
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.
Declaration
public virtual void SaveLayout(string fileName)
Parameters
fileName
The full path to the file where the layout data will be saved.
Events
KeySending
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.
Declaration
public event VirtualKeyboardKeySendingEventHandler KeySending
Event Value
KeySent
Occurs after a key has been successfully sent to the target input control. This event provides notification that a key operation has been completed.
Declaration
public event VirtualKeyboardKeySentEventHandler KeySent
Event Value