OnFocusChanging(Sender: Object; Args: IListViewActionEventArgs);
Sender. The parameter that returns the component that generated the event.
Args. The parameter that enables the user to determine event parameters.
The OnFocusChanging event occurs before focus is changed for the component element.
Executing the example requires a form and the ListView component named ListView1 on the form. 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 element text corresponds to 3, it is prohibited to pass the focus to this element.
See also: