Class 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.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadVirtualKeyboard : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider
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
System.Drawing.Size
|
Focusable
This property is not relevant for this class.
Declaration
public override bool Focusable { get; set; }
Property Value
System.Boolean
|
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
KeyboardLayoutType
|
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
VirtualKeyboardLayoutPanel
|
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.
Declaration
public bool ScaleFontOnResize { get; set; }
Property Value
System.Boolean
|
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
System.Boolean
|
Text
This property is not relevant for this class.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
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.
Declaration
public bool UseClickSound { get; set; }
Property Value
System.Boolean
|
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
RadVirtualKeyboardElement
|
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
public ComponentXmlSerializationInfo XmlSerializationInfo { get; set; }
Property Value
ComponentXmlSerializationInfo
|
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.
Declaration
public virtual SizeF CalculateDesiredSize()
Returns
System.Drawing.SizeF
A System.Drawing.SizeF representing the recommended dimensions for the virtual keyboard. |
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
RadElement
element
The RadElement to evaluate for design-time visibility. |
Returns
System.Boolean
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
System.Windows.Forms.AccessibleObject
An System.Windows.Forms.AccessibleObject that provides accessibility support for the virtual keyboard. |
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
RadVirtualKeyboardElement
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
ComponentXmlSerializationInfo
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.
Declaration
public virtual void LoadLayout(Stream stream)
Parameters
System.IO.Stream
stream
The System.IO.Stream containing XML layout data to be loaded. |
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
System.String
fileName
The full path to the XML file containing the saved layout configuration. |
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.
Declaration
public virtual void LoadLayout(XmlReader xmlReader)
Parameters
System.Xml.XmlReader
xmlReader
The System.Xml.XmlReader containing the XML layout data to be processed. |
OnKeyDown(KeyEventArgs)
This method is not relevant for this class.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
OnKeyPress(KeyPressEventArgs)
This method is not relevant for this class.
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
System.Windows.Forms.KeyPressEventArgs
e
|
Overrides
OnKeyUp(KeyEventArgs)
This method is not relevant for this class.
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
OnPreviewKeyDown(PreviewKeyDownEventArgs)
This method is not relevant for this class.
Declaration
protected override void OnPreviewKeyDown(PreviewKeyDownEventArgs e)
Parameters
System.Windows.Forms.PreviewKeyDownEventArgs
e
|
Overrides
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.
Declaration
public virtual void SaveLayout(Stream stream)
Parameters
System.IO.Stream
stream
The System.IO.Stream where the XML layout data will be written. |
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
System.String
fileName
The full path to the file where the layout data will be saved. |
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.
Declaration
public virtual void SaveLayout(XmlWriter xmlWriter)
Parameters
System.Xml.XmlWriter
xmlWriter
The System.Xml.XmlWriter used to write the serialized layout data. |
Events
KeyDown
This event is not relevant for this class.
Declaration
public event KeyEventHandler KeyDown
Event Type
System.Windows.Forms.KeyEventHandler
|
KeyPress
This event is not relevant for this class.
Declaration
public event KeyPressEventHandler KeyPress
Event Type
System.Windows.Forms.KeyPressEventHandler
|
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 Type
VirtualKeyboardKeySendingEventHandler
|
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 Type
VirtualKeyboardKeySentEventHandler
|
KeyUp
This event is not relevant for this class.
Declaration
public event KeyEventHandler KeyUp
Event Type
System.Windows.Forms.KeyEventHandler
|
PreviewKeyDown
This event is not relevant for this class.
Declaration
public event PreviewKeyDownEventHandler PreviewKeyDown
Event Type
System.Windows.Forms.PreviewKeyDownEventHandler
|