zoukankan      html  css  js  c++  java
  • cxDBTreeList:最简单的节点图标添加方法

    先在窗体上放ImageList关联到cxDBTreeList,在cxDBTreeList的GetNodeImageIndex事件中写如下:
    procedure cxDBTreeList1GetNodeImageIndex(Sender:
    TcxCustomTreeList; ANode: TcxTreeListNode; AIndexType:
    TcxTreeListImageIndexType; var AIndex: TImageIndex);
    
    var
    i :Integer;
    begin
    //给树结点加上图标
    for i := 0 to ANode.ValueCount do
    begin
    if ANode.Level = 0 then
    begin
    ANode.ImageIndex := 0;
    end
    else
    if ANode.Level = 1 then
    begin
    ANode.ImageIndex := 2;
    end
    else
    if ANode.Level = 2 then
    begin
    ANode.ImageIndex := 1;
    end;
    end;
    end;
    ////=====================
     cxDBTreeList1.fullexpand;  //cxdbtreelist1自动展开节点。
     cxdbtreelist1自动折叠 :    cxDBTreeList1.FullCollapse;
     
    //=====================
    procedure Tfrmjiankongxinxi.cxDBTreeList1DblClick(Sender: TObject);
    var i,sn:Integer;
    begin
    for i:=0 to cxDBTreeList1.SelectionCount-1 do
        begin
              //ShowMessage(cxDBTreeList1.Selections[i].Values[i]);
    
              if cxDBTreeList1.FocusedNode.Level=1 then   //判断是不是子节点,1是子节点,0是父节点
               ShowMessage(cxDBTreeList1.Selections[i].Values[i])  //取节点名
              else
              end;
    
    
    end;
     
  • 相关阅读:
    Linux 修改时区(debain)
    C#生成验证码
    httpPost 请求
    C# Array.FindAll
    C#删除字符串中所有的空字符
    C# 获取汉字区位码
    Qinq Vlan mapping 和DHCP 服务器
    Sql 分页存储过程
    request 之getParameterMap 方法
    如果我是面试官
  • 原文地址:https://www.cnblogs.com/windson/p/12505100.html
Copyright © 2011-2022 走看看