[Duvida]TShellListView

Started by OnlyOne, 30 de August , 2006, 05:28:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

OnlyOne

ae moçada , to trabalhando com com este componente ai , mas nao consigo fazer uma coisa

alguem ai sabe como q faz para selecionar varios arquivos na lista e depois obter o nome dos arquivos selecionados ?
No céu toca Joy Division


OnlyOne

bom acabei achando a resposta , podem trancar o topico

{+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ShellListView does not have a files property (common in dialogs eg TOpendialog),
therefore we have to cycle through each item to find out whether the
item is selected or not.

Use this function to obtain a list of selected files in a ShellListView:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}

function SelectedFiles(AShellView: TShellListView): TStringList;
begin
  Result := TStringList.Create;
  for i := 0 to shelllistview1.Items.Count - 1 do
    // is the item selected?
    if shelllistview1.Items.Selected = True then
      // Folders can also refer to files, which is why we check isFolder
      // before adding the filepath to the result
      if shelllistview1.folders.IsFolder = False then
        // add filepath and filename to result
        Result.Add(shelllistview1.Folders.PathName);
No céu toca Joy Division