在FileListBox中我的文件名是按这样显示的:
  Dsc_0001.jpg
  Dsc_0002.jpg
  Dsc_0003.jpg
     .
     .
     .
  Dsc_0090.jpg
我现在想这样显示:
  Dsc_0090.jpg
  Dsc_0089.jpg
  Dsc_0088.jpg
     .
     .
     .
  Dsc_0001.jpg 请问前辈们如何实现呢?FileListBox好像没有这样的属性。

解决方案 »

  1.   

    再编个排序函数。
    procedure TForm1.Button1Click(Sender: TObject);
    var
      i,j:integer;
      temp:string;
    begin
        For i:=0 to FileListBox1.Items.Count-2 do
        for j:=i+1 to FileListBox1.Items.Count-1 do
          if FileListBox1.Items.Strings[i]<FileListBox1.Items.Strings[j] then
          begin
          temp:=FileListBox1.Items.Strings[i];
          FileListBox1.Items.Strings[i]:=FileListBox1.Items.Strings[j];
          FileListBox1.Items.Strings[j]:=temp;
          end;
    end;
      

  2.   

    改用NameSpace,ShellControl组件的OnCompare处理就可以了
      

  3.   

    要不是就用ListBox,自己写代码都OK