jetzt hab auch ich das begriffen ...
Delphi-Quellcode:
function CustomSortProc(Item1, Item2: TListItem; ParamSort: integer): integer; stdcall;
begin
case ParamSort of
0 : Result := -CompareText(Item1.SubItems.Text,Item2.SubItems.Text);
1 : Result := CompareText(Item1.SubItems.Text,Item2.SubItems.Text);
2 : Result := -CompareText(Item1.Caption,Item2.Caption);
3 : Result := CompareText(Item1.Caption,Item2.Caption);
end;
end;
procedure TForm1.ListeColumnClick(Sender: TObject;
Column: TListColumn);
var ColumnToSort: Integer;
begin
ColumnToSort := Column.Index;
case ColumnToSort of
1 : begin
if posVZ [1] = true then begin
Liste.CustomSort(@CustomSortProc, 0);
posVZ [1] := false;
end
else begin
Liste.CustomSort(@CustomSortProc, 1);
posVZ [1] := true;
end;
end;
else begin
if posVZ [2] = true then begin
Liste.CustomSort(@CustomSortProc, 2);
posVZ [2] := false;
end
else begin
Liste.CustomSort(@CustomSortProc, 3);
posVZ [2] := true;
end;
end;
end;
end;
Hoffe, dass es jetzt nich ganz falsch is