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;

相关阅读 >>

Delphi从路径中分离文件名

Delphi pagecontrol当前页可视

Delphi with do和for do语句

Delphi 中主设置静音的方式

Delphi 获取百度ai 获取token

Delphi 程序嵌入桌面效果的实现

橙子作品 bds/cds 下的 web deploy 工具

Delphi tdirectory.tfilterpredicate

Delphi trunc转换函数

Delphi下cpu getcpuid实现(x86和x64)

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



打赏

取消

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

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

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

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

评论

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