ClassKey
The key class represents a single button on a physical keyboard. Letters, numbers, functions, and symbols are all represented on keys.
Definition
Namespace:Telerik.WinControls.VirtualKeyboard
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class Key : LightVisualRepeatButtonElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IKey
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementLightVisualButtonElementLightVisualRepeatButtonElementKey
Derived Classes:
Implements:
Inherited Members
Constructors
Key(int, KeyType, double, double, bool, bool)
Initializes a new instance of the Key class.
Declaration
public Key(int keyCode, KeyType keyType, double width, double height, bool sharpStyle = false, bool showSecondaryText = false)
Parameters
keyCode
The virtual key code.
keyType
The type of the key.
width
The logical key width.
height
The logical key height.
sharpStyle
Indicates whether the key has more noticeable(sharp) style.
showSecondaryText
Indicates whether to show the secondary text element.
Key(int, string, KeyType, double, double, bool, bool, Font)
Initializes a new instance of the Key class.
Declaration
public Key(int keyCode, string displayText, KeyType keyType, double width, double height, bool sharpStyle = false, bool showSecondaryText = false, Font font = null)
Parameters
keyCode
The virtual key code.
displayText
The display text.
keyType
The type of the key.
width
The logical key width.
height
The logical key height.
sharpStyle
Indicates whether the key has more noticeable(sharp) style.
showSecondaryText
Indicates whether to show the secondary text element.
font
The font specified to the key element.
Fields
IsSharpStyleProperty
Dependency property that indicates whether the key should have more noticeable/sharp style.
Declaration
public static RadProperty IsSharpStyleProperty
Field Value
SecondaryForeColorProperty
Dependency property that defines the fore color of secondary text element.
Declaration
public static RadProperty SecondaryForeColorProperty
Field Value
Properties
AccessibleName
Gets or sets the name of the control for use by accessibility client applications.
Declaration
public override string AccessibleName { get; set; }
Property Value
Overrides
DisplayText
Gets or sets the display text.
FontScale
Gets or sets the font scale coefficient, used when key is larger or smaller than the KeyDefaultSize.
ForeColor
Gets or sets the foreground color. Color type represents an ARGB color. Note that then shift key is active and secondary text is shown, the SecondaryForeColor value will be returned as ForeColor.
Declaration
public override Color ForeColor { get; set; }
Property Value
Overrides
IsSharpStyle
Gets or sets a value indicating whether the key will have more noticeable/sharp style.
KeyHeight
Gets or sets the logical key height.
KeyInfo
Gets or sets the associated key info object.
Declaration
public KeyInfo KeyInfo { get; set; }
Property Value
Implements
KeyRectangle
Gets or sets the logical key bounds.
Declaration
public RectangleF KeyRectangle { get; set; }
Property Value
Implements
KeyType
Gets the type of the key.
Declaration
public KeyType KeyType { get; set; }
Property Value
Implements
KeyWidth
Gets or sets the logical key width.
Owner
Gets the owner element used to send the keys.
Declaration
public IVirtualKeyboardKeyInputSender Owner { get; }
Property Value
Implements
SecondaryForeColor
Gets or sets the secondary text fore color.
SecondaryTextElement
Gets the element that display the secondary text.
Declaration
public LightVisualElement SecondaryTextElement { get; }
Property Value
ShowSecondaryText
Gets or sets a value indicating whether to show the secondary text.
ThemeEffectiveType
Gets the type by which this instance is being themed.
Declaration
protected override Type ThemeEffectiveType { get; }
Property Value
Overrides
VirtualKey
Gets the virtual key code.
Methods
ArrangeKey(RectangleF)
Arranges the key in the specified rectangle.
Declaration
public void ArrangeKey(RectangleF rectangle)
Parameters
rectangle
The layout rectangle.
Implements
CreateChildElements()
Called by the element when constructed. Allows inheritors to build the element tree.
Declaration
protected override void CreateChildElements()
Overrides
CreateSecondaryTextElement()
Creates a SecondaryTextElement used as an element to display the secondary text.
Declaration
protected virtual SecondaryTextElement CreateSecondaryTextElement()
Returns
GetKeyScaleCoefficient(float, bool)
Gets the font scale coefficient
GetScaledFont(float)
Scales the Font used by the Paint process. The Font property is not changed.
InitializeFields()
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
Declaration
protected override void InitializeFields()
Overrides
OnClick(EventArgs)
Raises the Click event.
Declaration
protected override void OnClick(EventArgs e)
Parameters
e
Overrides
OnLoaded()
Called when the element has been successfully loaded. That includes loading of all its children as well.
Declaration
protected override void OnLoaded()
Overrides
SendKey()
Sends a virtual key code or string.
Declaration
public virtual void SendKey()
Implements
UpdateKey()
Updates key text and other necessary styles.
Declaration
public virtual void UpdateKey()
Implements