Board index » delphi » ListView equivalent of TListBox.TopIndex property

ListView equivalent of TListBox.TopIndex property

I need to append some ListItems to a TListView component when hitting the
<DOWN arrow> key after reaching the last ListItem in a TListView component.
What I can't figure out is how to reposition the first of the newly appended
ListItems to be the first item displayed at the top of the list box.  In
this regard, I'm looking for something similar to the TListBox property,
TopIndex.  For the TListView, the corresponding property would be TopItem,
but it's read-only.

Any suggestions or ideas on this matter?  Any comments would be appreciated.

Thanks in advance,
David Jensen

 

Re:ListView equivalent of TListBox.TopIndex property


Hi David,

Quote
> I need to append some ListItems to a TListView component when hitting the
> <DOWN arrow> key after reaching the last ListItem in a TListView component.
> What I can't figure out is how to reposition the first of the newly appended
> ListItems to be the first item displayed at the top of the list box.  In
> this regard, I'm looking for something similar to the TListBox property,
> TopIndex.  For the TListView, the corresponding property would be TopItem,
> but it's read-only.

If you use the Insert() method of TListItems, then you can add the new item to
the top of the list...

        ListView1.Items.Insert(0);

HTH.

Damon Chandler

Other Threads