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中datetimepicker组件介绍

Delphi 获取所有磁盘分区

Delphi编程之win10桌面图标设置

Delphi隐藏当前进程(新)

Delphi 判断按键状态

Delphi访问mysql乱码问题

Delphi 编写网址加密解密代码

Delphi 使用tnethttprequest / tnethttpclient访问web服务器

Delphi idhttp中设置非标准头信息和读写cookie

Delphi'控件的相对坐标与屏幕坐标转换

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



打赏

取消

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

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

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

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

评论

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