Show contents 

Forms > Forms Assembly Interfaces > IControl > IControl.OnKeyUp

OnKeyUp

Syntax

OnKeyUp(Sender: Object; Args: IKeyEventArgs);

Parameters

Sender. The parameter that returns the component that has generated the event.

Args. The parameter that enables the user to determine event parameters.

Description

The OnKeyUp event occurs if the component is in focus when the user releases any pressed key including such auxiliary keys as CTRL, SHIFT, and ALT.

Comments

If it is not necessary to recognize the auxiliary keys pressing, it is reasonable to use the OnKeyPress event.

Example

Executing the example requires a form. Several components that can receive focus are placed on the form. The following procedure is used as a handler of the OnKeyUp event for all components:

Sub OnKeyUp(Sender: Object; Args: IKeyEventArgs);
Begin
    If (Args.ShiftState = ShiftState.Ctrl) And (Args.Key = Keys.B) Then
        Text := (Sender As IControl).Name + " Up";
    End If;
End Sub OnKeyUp;

After executing the example, if CTRL+B was pressed and released in the area of any component, the name of this component with the Up word is displayed in the form name.

See also:

IControl