How to add subitems of a ListView in a Memo?

4

I have a ListView with 5 fields. I need to get the field number 5 from the ListView and add it to a Memo.

I tried the following:

Memo1.Lines.Add(LV1.Selected.SubItems[5]);

Unfortunately it did not work out. He does not make any mistakes, but he does not do anything either. What can I be doing wrong?

    
asked by anonymous 17.04.2014 / 15:29

1 answer

2

Get the list of all items in your ListView, then grab the fifth item from the list, and finally get your text. Example:

Memo1.Lines.Add(LV1.Items.Item[4].Caption); //se quiser pegar o quinto ponha índice 4
    
17.04.2014 / 15:48