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;

  

Delphi的ListView自动排序的更多相关文章

  1. 点击listview 的列头对其item进行自动排序

    若要自定义排序顺序,必须编写一个实现 IComparer 接口的类,并将 ListViewItemSorter 属性设置为该类的一个对象.当设置 ListViewItemSorter 属性值时,将自动 ...

  2. 禁用datagridview中的自动排序功能

    把datagridview中的自动排序功能禁用自己收集的两种方法,看看吧①DataGridView中的Columns属性里面可以设置.进入"EditColumns"窗口后,在相应的 ...

  3. sublime插件 cssComb实现css自动排序及格式化

    cssComb是一个实现css代码自动排序,当然顺便也实现了代码的格式化 安装: 首先需要打开sublime搜索安装csscomb插件(前提是已经安装了sublime的package control) ...

  4. DataGridView点击排序完成后如何禁止自动排序

    Summary: Disable sorting after clicking DataGridView columnheader,Prevent databound DataGridView fro ...

  5. 实现Android ListView 自动加载更多内容

    研究了几个小时终于实现了Android ListView 自动加载的效果. 说说我是怎样实现的.分享给大家. 1.给ListView增加一个FooterView,调用addFooterView(foo ...

  6. ListView 分页 排序、编辑、插入和删除

    摘自网络地址:http://msdn.microsoft.com/zh-cn/magazine/cc337984.aspx ListView 基础 ListView 是模板驱动的控件,这意味着它默认情 ...

  7. yii去掉自动排序功能

    Yii去掉自动排序功能并自定义排序 public function search($params) { $query = SvnManage::find()->addOrderBy([ 'cre ...

  8. C++的STL之map自动排序特性

    #include <iostream> #include <map> using namespace std; int main() {方法一: map<int,int& ...

  9. 数据更新后让ListView自动滚动到底部

    在做聊天界面的时候想要发送新的数据后,listview自动滚动到底部,显示出最新的数据.网上找了两个方法,觉得不错,记录一下. 方法一: 给listview添加下面两个属性 android:stack ...

随机推荐

  1. 利用cookie实现“只弹出一次窗口”的JS代码

    弹出式窗口通常被用来做弹出广告(CPM),其实用弹出式窗口用来做消息通知也是最普遍而且是最有效的方法,但如果每次刷新页面特别是刷新首页都要弹出窗口的话,那绝对是让访问者厌烦的事情. 比如你将上面的脚本 ...

  2. C# 开发技巧]如何防止程序多次运行 线程 进程

    程序员必有一些好习惯,我的就是看到好文章就收下 文章来源   http://www.cnblogs.com/zhili/p/OnlyInstance.html 转载请注明出处 最近发现很多人在论坛中问 ...

  3. 安卓 Android题目大全

    安卓001个人事务管理系统(单端) 安卓002手机订餐系统 安卓003无线点菜 安卓004酒店房间预定系统 安卓005个人相册管理系统(单端) 安卓006计算器(单端) 安卓007英语学习(单端) ...

  4. 转发:招聘一个靠谱的 iOS

    觉得很瘦感触,因此转发:http://blog.sunnyxx.com/2015/07/04/ios-interview/ 近一年内陆续面试了不少人了,从面试者到面试官的转变让我对 iOS 招聘有了更 ...

  5. Delphi中建立指定大小字体和读取该字体点阵信息的函数(转)

    源:Delphi中建立指定大小字体和读取该字体点阵信息的函数 Delphi中建立指定大小字体和读取该字体点阵信息的函数 作者:Thermometer Email:  webmaster@daheng- ...

  6. C# 6.0 11个新特性

    1. 静态using(static using) 静态using声明允许不使用类名直接调用静态方法. The static using declaration allows invoking stat ...

  7. Linux挂在ntfs格式的U盘

    工作中遇到linux系统 Red Hat Enterprise5.7 挂载希捷ntfs格式移动硬盘,会跳出一个ERROR提示框:The volume ‘EAGET-NQH’user the ntfs ...

  8. (中等) HDU 4370 0 or 1,建模+Dijkstra。

    Description Given a n*n matrix C ij (1<=i,j<=n),We want to find a n*n matrix X ij (1<=i,j&l ...

  9. Instruments使用实战

    http://www.cocoachina.com/ios/20150225/11163.html 最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析 ...

  10. HUST 1605 Gene recombination

    简单广搜.4进制对应的10进制数来表示这些状态,总共只有(4^12)种状态. #include<cstdio> #include<cstring> #include<cm ...