如果sorttyp = stData,说明是要你自己在Oncompare事件里写代码自己排序,不一定是根据data指针链接的数值排序,可以是根据任何可以比较大小的数据进行排序。
解决方案 »
- 各位有没有经常买彩票??
- 更高级的数据分页操做
- 程序最小化到图标栏的程序大家看看有什么错~
- 如何取得宽带上网的IP地址,解决给分,在线.....
- 急急,rxlib 问题(在线等候,今天结贴)
- #$B8的问题,知道的大侠务必进来看看,多谢了
- 复制目录的问题,急!
- 放分最爽了
- 请教高手,delhi中,直接给aa1:=2.00,bb1:=8;怎么不执行?
- 高手请进,来者有分
- InstallShield Express for delphi怎么用
- QuickRep中放置QRExpr控件,在编辑统计函数时可它就是找不到我放在 DataModule 中的Query---------------------------------------------
procedure TfrmXgTest.ListView1Compare(Sender: TObject; Item1,
Item2: TListItem; Data: Integer; var Compare: Integer);data是什么?
返回的应该是compare吧?可值应该是怎样的?
Compare:=Data;
when OnCompare occurs in response to the AlphaSort method, the Data parameter is 0. When OnCompare occurs in response to the CustomSort method, the Data parameter is the value of the LParam parameter of CustomSort.
如果用户调用了AlphaSort,那么data是0,如果调用了CustomSort,data是在CustomSort里指定的LParam参数的值。If Item1 is the same as Item2 in the sort order, set the Compare parameter to 0. If Item1 is less than Item2, set the Compare parameter to a value less than 0. If Item1 is greater than Item2, set the Compare parameter to a value greater than 0.
你可以通过把Compare设置为>0,=0 ,<0来决定Item1、item2如何排序。
在OnCompare的帮助里有例子。