TreeView设置节点图标
没子节点的设置其图标为 0
有节点的设置其图标为 1

procedure TForm1.Button1Click(Sender: TObject);
var
   i:Integer;
begin
    with TreeView1 do
    begin
      for i:= 0 to Items.Count -1 do
      begin
         if Items[i].HasChildren then
            begin
              Items[i].ImageIndex:=0;
              Items[i].SelectedIndex:=0;
              Items[i].StateIndex:=0;
            end
         else
            begin
              Items[i].ImageIndex:=1;
              Items[i].SelectedIndex:=1;
              Items[i].StateIndex:=1;
            end;
      end;
    end;
end;

TreeView设置节点图标的更多相关文章

  1. DELPHI TreeView 文件目录树和 设置节点图标 完整

        DELPHI TreeView 文件目录树和 设置节点图标   下载地址 http://download.csdn.net/detail/teststudio/6448293     需要制作 ...

  2. C# WinForm设置TreeView选中节点

    这里假定只有两级节点,多级方法类似.遍历节点,根据选中节点文本找到要选中的节点.treeView.SelectedNode = selectNode; /// <summary> /// ...

  3. TreeView中节点勾选设置

    本文转载:http://www.cnblogs.com/luxiaoxun/p/3288003.html 很不错的文章:http://www.cnblogs.com/allen0118/archive ...

  4. delphi treeview的子节点图标?

    代码实现不同的子节点图标效果. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, ...

  5. Dev TreeList 添加节点图标问题

    1. 在设计界面添加imageCollection控件,在属性页设置图标(可Load from disk,也可从Load from dev gallery) 2. TreeList控件有一个叫做Cus ...

  6. TreeView 树节点的处理

    TreeView 树节点的处理 using System; using System.Collections.Generic; using System.ComponentModel; using S ...

  7. iOS----Xcode6或者Xcode7设置LaunchImage图标

    最近设置LaunchImage图标时发现怎么都没有效果,后来发现是Xcode6中新建项目的时候会默认添加一个LaunchScreen.xib的文件,我们启动程序的时候也会发现,加载的时LaunchSc ...

  8. WinForm------TreeList修改节点图标和按钮样式

    转载: https://documentation.devexpress.com/#WindowsForms/DevExpressXtraTreeListTreeList_CustomDrawNode ...

  9. TreeView查获节点并选中节点

    TreeView查获节点并选中节点如果有多个节点则会继续查找下一个节点 支持关键字搜索 private void SearchNodes(string SearchText, TreeNode Sta ...

随机推荐

  1. phpmailer 发送邮件

    <?php /* 可用新浪和网易邮箱测试成功,但QQ不成功! 下载 phpmailer 解压 http://phpmailer.worxware.com/ 要注意邮件服务器的端口号,默认是 25 ...

  2. Python 手册——解释器及其环境

    错误处理: 有错误发生时,解释器打印一个错误信息和栈跟踪(监视)器?.交互模式下,它返回主提示符,如果从文件 输入执行,它在打印栈跟踪器后以非零状态退出.(异常可以由try语句中的except子句来控 ...

  3. UML for Design Pattern

    ************************************************************************************* ************** ...

  4. myeclipse 添加服务器运行时环境

    像servlet-api.jar.servlet-api.jar服务器能提供的包 解决方法如下: 1,File->New->Other->Server->Server(注意在n ...

  5. 学习Swift -- 协议(上)

    协议(上) 协议是Swift非常重要的部分,协议规定了用来实现某一特定工作或者功能所必需的方法和属性.类,结构体或枚举类型都可以遵循协议,并提供具体实现来完成协议定义的方法和功能.任意能够满足协议要求 ...

  6. css3 3D盒子效果

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  7. Servo: The Embeddable Browser Engine

    Embedding, in the context of this article, is the process of hosting a web rendering engine inside a ...

  8. node案例

    http://www.cnblogs.com/wewe/archive/2010/03/19/1685658.html http://www.laonan.net/blog/69/ http://cn ...

  9. Windows常见蓝屏故障分析

    转自Windows常见蓝屏故障分析 症状描述: 当您在运行Microsoft Windows 2000/XP/Server 2003.Microsoft Windows Vista/Server 20 ...

  10. SlimFTPd, LFTP和FileZilla Client/Server

    https://lftp.yar.ru/ 绝好的Socket项目