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

A factory used to create key instances.

Definition

Namespace:Telerik.WinControls.VirtualKeyboard

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class KeyFactory : IKeyFactory

Inheritance: objectKeyFactory

Implements: IKeyFactory

Constructors

C#
public KeyFactory()

Methods

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

C#
public virtual IKey CreateKey(int keyCode, KeyType keyType = KeyType.Normal, 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.

Implements: IKeyFactory.CreateKey(int, KeyType, double, double, bool, bool)

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

C#
public virtual 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.

Implements: IKeyFactory.CreateNumpadKey(int, string, int, string, double, double, bool, Font, Font)

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

C#
public virtual IKey CreateSpecialKey(int keyCode, string displayText, KeyType keyType = KeyType.Normal, 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.

Implements: IKeyFactory.CreateSpecialKey(int, string, KeyType, double, double, bool, Font)