Recent

Author Topic: Having trouble to figure out how to get multiselection in TListView  (Read 679 times)

asdlinux

  • New Member
  • *
  • Posts: 17
Hello everyone,

I am new to Pascal and Lazarus, I am making a simple file manager learn Lazarus. I am getting stuck on multiselection on TListView.
I have found this Delphi example.

Code: Pascal  [Select]
  1.  procedure TForm1.Button1Click(Sender: TObject);
  2. var
  3.   Item: TListItem;
  4. begin
  5.   Item := ListView1.Selected;
  6.   while Item <> nil do
  7.   begin
  8.     ListBox1.Items.Add(Item.Caption);
  9.     Item := ListView1.GetNextItem(Item, sdAll, [isSelected]);
  10.   end;
  11. end;


When i try to compile this ... It gives Error: Identifier not found "isSelected" and i can't figure out how to get that identifier. Can anyone give me a hint ?

Thank you !!!

lucamar

  • Hero Member
  • *****
  • Posts: 2018
Re: Having trouble to figure out how to get multiselection in TListView
« Reply #1 on: January 18, 2019, 03:44:49 pm »
The name is lisSelected (starting with "L"), not just IsSelected.

HTH
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

asdlinux

  • New Member
  • *
  • Posts: 17
Re: Having trouble to figure out how to get multiselection in TListView
« Reply #2 on: January 18, 2019, 04:34:17 pm »
That worked... it compiles now... thank you very much !!!