Delphi XE5的新功能“ TListView内置搜索过滤”
2022-12-04 10:51:02 作者:admin
本文整理自网络,侵删。
在窗体的OnCreate事件中初始化TListView项。
procedure TForm1.FormCreate(Sender: TObject);const Books: array [0 .. 4] of string = ( 'Delph abc', 'Delphi XE2入门', ' by DelphiXE', 'Delphi 2009 handbook');var Book: string;begin for Book in Books do begin ListView1.Items.Add.Text := Book; end;end;在Button1的OnClick事件中执行搜索过滤。
procedure TForm1.Button1Click(Sender: TObject);var SearchResponder: ISearchResponder;begin SearchResponder := ListView1 as ISearchResponder; SearchResponder.SetFilterPredicate( function(Arg: string): Boolean begin Result := Arg.StartsWith('Delphi'); end);end;
相关阅读 >>
Delphi trayicon控件,如何实现窗口最小化的时候到系统托盘?
Delphi 显示简单图形
Delphi汇编级初探
Delphi完美的线程注入和卸载
Delphi获取ie路径
Delphi 覆盖模式处理透明
Delphi中如何控制webbrowser滚动条
android实例-拍摄和分享照片、分享文本(xe8+小米2)
Delphi 获取unigui 控件id 及获取html值
Delphi 用tidsmip和tidmessage发送邮件
更多相关阅读请进入《Delphi》频道 >>
猜你喜欢
联络方式:
400-123-789
邮箱:xiachao@163.com
Q Q:12345678
微信公众号
微信二维码