Recent

Author Topic: Having trouble to figure out how to get multiselection in TListView  (Read 1334 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: 4219
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/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and 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 !!!

 

TinyPortal © 2005-2018