Delphi的ListView自动排序
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自动排序的更多相关文章
- 点击listview 的列头对其item进行自动排序
若要自定义排序顺序,必须编写一个实现 IComparer 接口的类,并将 ListViewItemSorter 属性设置为该类的一个对象.当设置 ListViewItemSorter 属性值时,将自动 ...
- 禁用datagridview中的自动排序功能
把datagridview中的自动排序功能禁用自己收集的两种方法,看看吧①DataGridView中的Columns属性里面可以设置.进入"EditColumns"窗口后,在相应的 ...
- sublime插件 cssComb实现css自动排序及格式化
cssComb是一个实现css代码自动排序,当然顺便也实现了代码的格式化 安装: 首先需要打开sublime搜索安装csscomb插件(前提是已经安装了sublime的package control) ...
- DataGridView点击排序完成后如何禁止自动排序
Summary: Disable sorting after clicking DataGridView columnheader,Prevent databound DataGridView fro ...
- 实现Android ListView 自动加载更多内容
研究了几个小时终于实现了Android ListView 自动加载的效果. 说说我是怎样实现的.分享给大家. 1.给ListView增加一个FooterView,调用addFooterView(foo ...
- ListView 分页 排序、编辑、插入和删除
摘自网络地址:http://msdn.microsoft.com/zh-cn/magazine/cc337984.aspx ListView 基础 ListView 是模板驱动的控件,这意味着它默认情 ...
- yii去掉自动排序功能
Yii去掉自动排序功能并自定义排序 public function search($params) { $query = SvnManage::find()->addOrderBy([ 'cre ...
- C++的STL之map自动排序特性
#include <iostream> #include <map> using namespace std; int main() {方法一: map<int,int& ...
- 数据更新后让ListView自动滚动到底部
在做聊天界面的时候想要发送新的数据后,listview自动滚动到底部,显示出最新的数据.网上找了两个方法,觉得不错,记录一下. 方法一: 给listview添加下面两个属性 android:stack ...
随机推荐
- 常用的dos命名
注销:logoff 注册表:regedit 查看显存:dxdiag 删除文件: del +文件 删除文件夹: rd+(/s)+文件名 (/s表示删除文件下的子目录和文件); 系统配置实用程序: msc ...
- 【dp】 poj 1953
用n个数字0或者1组成一个排列,要求每两个1不相邻,问有多少种排法 dp[n][0]记录n个连续数,结尾为0的不同排列数dp[n][1]记录第n个连续数,结尾为1的不同排列数 DP公式: dp[i][ ...
- docker rancher 体验 (未完待续.....)
docker rancher 体验 官方 githubhttps://github.com/rancher/rancher 环境说明: 10.6.0.14010.6.0.18710.6.0.188 修 ...
- UML用例图说明
转自:http://www.360doc.com/content/10/1206/23/3123_75672033.shtml 前些时间参加了潘加宇老师的技术讲座,UML建模技术受益匪浅.我也把平时的 ...
- 数据库建表的时候报 “1215 Cannot add foreign key constraint”
很大原因是因为: 引用表中的字段类型和被引用的主键的类型不统一. 比如说学生表中有一个班级ID字段引用班级表. 班级表的ID是int类型,学生表中的班级ID是Varchar类型. 肯定会提示上述121 ...
- SpringMVC文件上传报错org.apache.catalina.connector.RequestFacade cannot be cast to org.springframework.web.multipart.MultipartHttpServletRequest
错误信息: java.lang.ClassCastException: org.apache.catalina.connector.RequestFacade cannot be cast to or ...
- mysql 插入数据后返回当前的自增ID方法
存储过程的写法: mysql>create procedure test( ->in username varchar(50), ->in password varchar(50), ...
- Nginx Image Module图片缩略图 水印处理模块
Nginx Image Module图片缩略图 水印处理模块 下载Tengine tar -zxvf tengine-1.4.5.tar.gz cd tengine-1.4.5 下载Nginx tar ...
- Mysql的MySqlDataReader对于MysqlConnection是独占式
写Secondlife智能体的知识系统小插件的时候遇到的这个问题. 在把某个NPC的全部知识复制给另一个NPC的时候,对数据库操作,为了提升一点效率希望与数据库建立一次连接,全部添加进表以后再断开连接 ...
- (中等) POJ 3660 Cow Contest,Floyd。
Description N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming con ...