New to Telerik UI for WinFormsStart a free 30-day trial

IKeyFactory

Interface

Exposes methods used to create keys for RadVirtualKeyboard.

Definition

Namespace:Telerik.WinControls.VirtualKeyboard

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public interface IKeyFactory

Derived Classes: KeyFactoryToggleKeyFactory

Methods

Creates a key that sends a virtual key code when pressed.

C#
IKey CreateKey(int keyCode, KeyType keyType, double width = 1, double height = 1, bool sharpStyle = false, bool showSecondaryText = false)
Parameters:keyCodeint

The virtual key code.

keyTypeKeyType

The type of the key.

widthdouble

The logical width of key.

heightdouble

The logical height of key.

sharpStylebool

Indicates whether the key has more noticeable(sharp) style.

showSecondaryTextbool

Indicates whether to show the secondary text element.

Returns:

IKey

The created IKey instance.

Creates a numpad key, which has two different virtual key codes to be sent depending on the state of Numlock key.

C#
IKey CreateNumpadKey(int numLockActiveCode, string activeKeyText, int alternateKeyCode, string alternateKeyText, double width = 1, double height = 1, bool sharpStyle = false, Font activeKeyFont = null, Font alternateKeyFont = null)
Parameters:numLockActiveCodeint

The virtual key code of active state.

activeKeyTextstring

The text in active state.

alternateKeyCodeint

The virtual key code in alternate mode.

alternateKeyTextstring

The text in alternate state.

widthdouble

The logical width of key.

heightdouble

The logical height of key.

sharpStylebool

Indicates whether the key has more noticeable(sharp) style.

activeKeyFontFont

The font specified to the key element in active state.

alternateKeyFontFont

The font specified to the key element in alternate state.

Returns:

IKey

The created IKey instance.

Creates a special key that sends a virtual key code when pressed and displays a text.

C#
IKey CreateSpecialKey(int keyCode, string displayText, KeyType keyType, double width = 1, double height = 1, bool sharpStyle = false, Font font = null)
Parameters:keyCodeint

The virtual key code.

displayTextstring

The display text.

keyTypeKeyType

The type of the key.

widthdouble

The logical width of key.

heightdouble

The logical height of key.

sharpStylebool

Indicates whether the key has more noticeable(sharp) style.

fontFont

The font specified to the key element.

Returns:

IKey

The created IKey instance.