Board index » delphi » Focus on element in listview

Focus on element in listview

How do set focus on element 2 or 3 in an listview component ??
I have a program where a user can delete elements in the listview width a
confirmation dialog, so if they delete element 2 , element 2 should have
focus and be selected when returning from the dialog box.

Alan Hebo

 

Re:Focus on element in listview


You have to set the ListItem in ListView.Selected, like

  ListView.Selected:= ListItem2;

or
  ListView.Selected:= ListView.Items[1];

Alan Hebo Jensen schrieb:

Quote
> How do set focus on element 2 or 3 in an listview component ??
> I have a program where a user can delete elements in the listview width a
> confirmation dialog, so if they delete element 2 , element 2 should have
> focus and be selected when returning from the dialog box.

> Alan Hebo

Other Threads