ListView.OnFocusChanging

Syntax

Sub OnFocusChanging(Sender: Object; Args: IListViewActionEventArgs);

Begin

//set of operators;

End Sub OnFocusChanging;

Parameters

Sender. Parameter that returns the component that generated the event.

Args. Parameter that enables the user to determine event parameters.

Description

The OnFocusChanging event occurs before focus is changed for the component element.

Example

Executing the example requires a form, the ListView component named ListView1 placed on it. Several elements has been created for the component.

Sub ListView1OnFocusChanging(Sender: Object; Args: IListViewActionEventArgs);

Begin

If (Args.Item.Text = "3") And (Not Args.Item.Focused) Then

Args.Allowed := False;

End If;

End Sub ListView1OnFocusChanging;

After executing the example, when the focused element is changed in the component, if the text of element corresponds to 3, it is prohibited to pass the focus to this element.

See also:

ListView