本文整理自网络,侵删。
private SortCol: Integer; SortWay: Integer; procedure TForm1.LVweColumnClick(Sender: TObject; Column: TListColumn);begin SortCol:=Column.Index; if (SortWay=1) then SortWay:=-1 else SortWay:=1; (Sender as TCustomListView).AlphaSort;end;procedure TForm1.LVweCompare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer);var t: Integer;begin if (SortCol=0) then begin Compare:=SortWay * CompareText(Item1.Caption,Item2.Caption); end else begin t:=SortCol-1; Compare:=SortWay * CompareText(Item1.SubItems[t],Item2.SubItems[t]); end;end;
――――――――――――――――
原文链接:https://blog.csdn.net/chinazhd/article/details/7311002
相关阅读 >>
Delphi mailurlmaybeinvalid 检测邮箱地址有效性
windows api 的数据类型与 Delphi 数据类型对照表
Delphi iddecodermime 对图像编码base64解码成图像文件
Delphi 把exe嵌入到自己的exe中。Delphi xe3
更多相关阅读请进入《Delphi》频道 >>