Delphi Firemonkey中ListboxAccessory图标切换


本文整理自网络,侵删。

 功能
1、Listbox Accessory图标变换
2、Listitem Detail如果为空,则补选中
3、aCheckmark切换


Delphi/Pascal

procedure TForm1.ListBox1ItemClick(const Sender: TCustomListBox;
  const Item: TListBoxItem);
var
  i: Integer;
begin
  for i := 0 to ListBox1.Count - 1 do
  begin
    if (ListBox1.Selected.ItemData.Detail = '') or (ListBox1.ItemIndex < 2) or
      (ListBox1.ListItems[i] <> ListBox1.Selected) then
      ListBox1.ListItems[i].ItemData.Accessory :=
        TListBoxItemData.TAccessory.aNone
    else
      ListBox1.ListItems[i].ItemData.Accessory :=
        TListBoxItemData.TAccessory.aCheckmark;
  end;
  if (ListBox1.ItemIndex < 2) or (ListBox1.Selected.ItemData.Detail = '') then
  begin
    ListBoxItem5.IsSelected := true;
    ListBoxItem5.ItemData.Accessory := TListBoxItemData.TAccessory.aCheckmark;
  end;
end;

相关阅读 >>

webbrower常见问题及解决方法

Delphi 字符串、文件路径 排序算法

Delphi使用cef4Delphi制作chromium谷歌内核浏览器

Delphi10.3读取json数组

Delphi searchbox1 基本用法

Delphi 遍历pe文件

Delphi webbrowser1 缩放网页

Delphi 枚举resource资源名

Delphi 简单电池电量显示

Delphi 获取局域网所有ip

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...