设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

12下一页
返回列表 发新帖
查看: 3934|回复: 10
打印 上一主题 下一主题

[ActiveX] ctExplorer控件的trAddPictureNode方法的使用说明(Dbi-Tech)

[复制链接]

点击这里给我发消息

跳转到指定楼层
1#
发表于 2015-1-13 10:45:54 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
dbi-tech公司出的控件系列在Access的兼容性非常好。我们从99年开始一直使用这套控件。这套控件里面其实最好用最耀眼的就是ctExplorer控件,它包括了ctListbar ctTree ctHtml ctListview等多个控件的组合,且可以实现面板拖位,每个面板显示和隐藏及每个面板可绑定其它控件。功能非常强大
我们以前的通用开发平台就是使用这个控件来实现的(http://www.office-cn.net/thread-60482-1-1.html)。
但这个控件中文帮助非常少。很多网友对这个控件不太熟悉。

这次主要讲一下它的树控件添加图片节点的方法

trAddPictureNode
1. 它主要有5个参数:分别是 "标题", "位置", "级别", "图片ID", "节点展开图片", "节点选中图片"

  位置:主要是决定这个节点的位置,默认为0,在最后添加
  级别:决定在树节点是处在第一级,第二级,还是第三级等
  图片ID:节点正常显示的图片。即在ctExplorer控件里的image集合中添加的图片的ID (与微软treeview树控件mscomctl.ocx不太相同的,微软的树控件需要imagelist配合,ctExplorer本身就集成 了imagelist控件功能
  节点展开的图片ID:节点展开后的图片(图标)
  节点选中的图片ID:节点选中后的图片(图标)

2. 详细的使用方法是:
ctExplorer1.trAddPictureNode "标题", "位置", "级别", "图片ID", "节点展开的图片", "节点选中的图片"

3. ctExplorer的其它方法也可以参考上面的说明
    如  trAddFontNode
          trAddNode
          trAddPictureFontNode
          trAddPictureFontNode

4. 以下代码是我们Access ERP系统里使用的ctExplorer代码,大家可用来参考

  1. '分为两级,第二级全部为 基础数据 日常事务 统计查询 决策分析
  2. intIndex = ctExplorer1.trAddPictureNode("天鸣Access ERP", 0, 1, 5, 0, 0)
  3. ctExplorer1.trNodeHeaderImage(intIndex) = True
  4. ctExplorer1.trNodeCargo(intIndex) = "0"
  5. ctExplorer1.trNodeHeader(intIndex) = True
  6. ctExplorer1.trNodeExpanded(intIndex) = True
  7. intIndex = ctExplorer1.trAddPictureNode("采购管理系统", 0, 2, 10, 0, 0)
  8. ctExplorer1.trNodeCargo(intIndex) = "1"
  9. 'ctExplorer1.trNodeExpanded(intIndex) = True
  10. intIndex = ctExplorer1.trAddPictureNode("基础数据", 0, 3, 3, 0, 0)
  11. ctExplorer1.trNodeCargo(intIndex) = "11"
  12. intIndex = ctExplorer1.trAddPictureNode("日常事务", 0, 3, 8, 0, 0)
  13. ctExplorer1.trNodeCargo(intIndex) = "12"
  14. intIndex = ctExplorer1.trAddPictureNode("统计查询", 0, 3, 9, 0, 0)
  15. ctExplorer1.trNodeCargo(intIndex) = "13"
  16. intIndex = ctExplorer1.trAddPictureNode("决策分析", 0, 3, 10, 0, 0)
  17. ctExplorer1.trNodeCargo(intIndex) = "14"

  18. intIndex = ctExplorer1.trAddPictureNode("销售管理系统", 0, 2, 10, 0, 0)
  19. ctExplorer1.trNodeCargo(intIndex) = "2"
  20. 'ctExplorer1.trNodeExpanded(intIndex) = True
  21. intIndex = ctExplorer1.trAddPictureNode("基础数据", 0, 3, 3, 0, 0)
  22. ctExplorer1.trNodeCargo(intIndex) = "21"
  23. intIndex = ctExplorer1.trAddPictureNode("日常事务", 0, 3, 8, 0, 0)
  24. ctExplorer1.trNodeCargo(intIndex) = "22"
  25. intIndex = ctExplorer1.trAddPictureNode("统计查询", 0, 3, 9, 0, 0)
  26. ctExplorer1.trNodeCargo(intIndex) = "23"
  27. intIndex = ctExplorer1.trAddPictureNode("决策分析", 0, 3, 10, 0, 0)
  28. ctExplorer1.trNodeCargo(intIndex) = "24"

  29. intIndex = ctExplorer1.trAddPictureNode("仓库管理系统", 0, 2, 10, 0, 0)
  30. ctExplorer1.trNodeCargo(intIndex) = "3"
  31. 'ctExplorer1.trNodeExpanded(intIndex) = True
  32. intIndex = ctExplorer1.trAddPictureNode("基础数据", 0, 3, 3, 0, 0)
  33. ctExplorer1.trNodeCargo(intIndex) = "31"
  34. intIndex = ctExplorer1.trAddPictureNode("日常事务", 0, 3, 8, 0, 0)
  35. ctExplorer1.trNodeCargo(intIndex) = "32"
  36. intIndex = ctExplorer1.trAddPictureNode("统计查询", 0, 3, 9, 0, 0)
  37. ctExplorer1.trNodeCargo(intIndex) = "33"
  38. intIndex = ctExplorer1.trAddPictureNode("决策分析", 0, 3, 10, 0, 0)
  39. ctExplorer1.trNodeCargo(intIndex) = "34"

  40. intIndex = ctExplorer1.trAddPictureNode("应收管理系统", 0, 2, 10, 0, 0)
  41. ctExplorer1.trNodeCargo(intIndex) = "4"
  42. 'ctExplorer1.trNodeExpanded(intIndex) = True
  43. intIndex = ctExplorer1.trAddPictureNode("基础数据", 0, 3, 3, 0, 0)
  44. ctExplorer1.trNodeCargo(intIndex) = "41"
  45. intIndex = ctExplorer1.trAddPictureNode("日常事务", 0, 3, 8, 0, 0)
  46. ctExplorer1.trNodeCargo(intIndex) = "42"
  47. intIndex = ctExplorer1.trAddPictureNode("统计查询", 0, 3, 9, 0, 0)
  48. ctExplorer1.trNodeCargo(intIndex) = "43"
  49. intIndex = ctExplorer1.trAddPictureNode("决策分析", 0, 3, 10, 0, 0)
  50. ctExplorer1.trNodeCargo(intIndex) = "44"


  51. intIndex = ctExplorer1.trAddPictureNode("应付管理系统", 0, 2, 10, 0, 0)
  52. ctExplorer1.trNodeCargo(intIndex) = "5"
  53. 'ctExplorer1.trNodeExpanded(intIndex) = True
  54. intIndex = ctExplorer1.trAddPictureNode("基础数据", 0, 3, 3, 0, 0)
  55. ctExplorer1.trNodeCargo(intIndex) = "51"
  56. intIndex = ctExplorer1.trAddPictureNode("日常事务", 0, 3, 8, 0, 0)
  57. ctExplorer1.trNodeCargo(intIndex) = "52"
  58. intIndex = ctExplorer1.trAddPictureNode("统计查询", 0, 3, 9, 0, 0)
  59. ctExplorer1.trNodeCargo(intIndex) = "53"
  60. intIndex = ctExplorer1.trAddPictureNode("决策分析", 0, 3, 10, 0, 0)
  61. ctExplorer1.trNodeCargo(intIndex) = "54"
复制代码

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
11#
发表于 2016-6-13 14:32:59 | 只看该作者
虚席
回复

使用道具 举报

10#
发表于 2015-1-13 17:37:13 | 只看该作者
不错
回复

使用道具 举报

9#
发表于 2015-1-13 13:27:21 | 只看该作者
tmtony 发表于 2015-1-13 12:41
免注册使用控件,可使用directcom
http://www.office-cn.net/thread-117593-1-1.html

你这个免注册控件好像只是针对Dll吧,不能ocx吧
现在我采取的是用打包的方法

点击这里给我发消息

8#
发表于 2015-1-13 12:41:03 | 只看该作者
免注册使用控件,可使用directcom
http://www.office-cn.net/thread-117593-1-1.html
7#
发表于 2015-1-13 12:00:16 | 只看该作者
相当于imageList+ListView+Treeview的样子,做导航效果不错。
只是分发给用户使用时,应该需要在客户端注册控件。——这个问题大家怎么解决的呢?

点击这里给我发消息

6#
 楼主| 发表于 2015-1-13 10:58:06 | 只看该作者
todaynew 发表于 2015-1-13 10:55
似乎可以循环设置吧?

哈哈,正是的,这代码 是2000年写的。那时没去优化,且是直接写在代码中。
后来给客户做,是直接从数据表读取这些信息了
5#
发表于 2015-1-13 10:55:23 | 只看该作者
似乎可以循环设置吧?
4#
发表于 2015-1-13 10:49:02 | 只看该作者
谢谢分享
回复

使用道具 举报

点击这里给我发消息

3#
 楼主| 发表于 2015-1-13 10:47:19 | 只看该作者

  1. intIndex = ctExplorer1.trAddPictureNode("出纳管理", 0, 2, 10, 0, 0)
  2. ctExplorer1.trNodeForeColor(intIndex) = RGB(155, 0, 155)
  3. ctExplorer1.trNodeCargo(intIndex) = "R"
  4. 'ctExplorer1.trNodeExpanded(intIndex) = True
  5. intIndex = ctExplorer1.trAddPictureNode("基础数据", 0, 3, 3, 0, 0)
  6. ctExplorer1.trNodeCargo(intIndex) = "R1"
  7. intIndex = ctExplorer1.trAddPictureNode("日常事务", 0, 3, 8, 0, 0)
  8. ctExplorer1.trNodeCargo(intIndex) = "R2"
  9. intIndex = ctExplorer1.trAddPictureNode("统计查询", 0, 3, 9, 0, 0)
  10. ctExplorer1.trNodeCargo(intIndex) = "R3"
  11. intIndex = ctExplorer1.trAddPictureNode("决策分析", 0, 3, 10, 0, 0)
  12. ctExplorer1.trNodeCargo(intIndex) = "R4"


  13. intIndex = ctExplorer1.trAddPictureNode("数据挖掘", 0, 2, 10, 0, 0)
  14. ctExplorer1.trNodeForeColor(intIndex) = RGB(110, 180, 20)
  15. ctExplorer1.trNodeCargo(intIndex) = "S"
  16. 'ctExplorer1.trNodeExpanded(intIndex) = True
  17. intIndex = ctExplorer1.trAddPictureNode("库存决策分析", 0, 3, 3, 0, 0)
  18. ctExplorer1.trNodeCargo(intIndex) = "S1"
  19. intIndex = ctExplorer1.trAddPictureNode("销售决策分析", 0, 3, 8, 0, 0)
  20. ctExplorer1.trNodeCargo(intIndex) = "S2"
  21. intIndex = ctExplorer1.trAddPictureNode("采购决策分析", 0, 3, 9, 0, 0)
  22. ctExplorer1.trNodeCargo(intIndex) = "S3"
  23. intIndex = ctExplorer1.trAddPictureNode("财务决策分析", 0, 3, 10, 0, 0)
  24. ctExplorer1.trNodeCargo(intIndex) = "S4"
  25. intIndex = ctExplorer1.trAddPictureNode("生产决策分析", 0, 3, 10, 0, 0)
  26. ctExplorer1.trNodeCargo(intIndex) = "S5"
  27. intIndex = ctExplorer1.trAddPictureNode("人员结构分析", 0, 3, 10, 0, 0)
  28. ctExplorer1.trNodeCargo(intIndex) = "S6"
  29. intIndex = ctExplorer1.trAddPictureNode("质量分析", 0, 3, 10, 0, 0)
  30. ctExplorer1.trNodeCargo(intIndex) = "S7"


  31. intIndex = ctExplorer1.trAddPictureNode("准时作业(JIT)", 0, 2, 10, 0, 0)
  32. ctExplorer1.trNodeForeColor(intIndex) = RGB(110, 180, 20)
  33. ctExplorer1.trNodeCargo(intIndex) = "T"
  34. 'ctExplorer1.trNodeExpanded(intIndex) = True
  35. intIndex = ctExplorer1.trAddPictureNode("计划编制", 0, 3, 3, 0, 0)
  36. ctExplorer1.trNodeCargo(intIndex) = "T1"
  37. intIndex = ctExplorer1.trAddPictureNode("领料送料管理", 0, 3, 8, 0, 0)
  38. ctExplorer1.trNodeCargo(intIndex) = "T2"
  39. intIndex = ctExplorer1.trAddPictureNode("生产统计", 0, 3, 9, 0, 0)
  40. ctExplorer1.trNodeCargo(intIndex) = "T3"
  41. intIndex = ctExplorer1.trAddPictureNode("物料在制", 0, 3, 10, 0, 0)
  42. ctExplorer1.trNodeCargo(intIndex) = "T4"
  43. intIndex = ctExplorer1.trAddPictureNode("看板管理", 0, 3, 10, 0, 0)
  44. ctExplorer1.trNodeCargo(intIndex) = "T5"


  45. intIndex = ctExplorer1.trAddPictureNode("ERP优化器(ERP引擎)", 0, 2, 10, 0, 0)
  46. ctExplorer1.trNodeForeColor(intIndex) = RGB(110, 180, 20)
  47. ctExplorer1.trNodeCargo(intIndex) = "U"
  48. 'ctExplorer1.trNodeExpanded(intIndex) = True
  49. intIndex = ctExplorer1.trAddPictureNode("物料资源优化", 0, 3, 3, 0, 0)
  50. ctExplorer1.trNodeCargo(intIndex) = "U1"
  51. intIndex = ctExplorer1.trAddPictureNode("能力资源优化", 0, 3, 8, 0, 0)
  52. ctExplorer1.trNodeCargo(intIndex) = "U2"
  53. intIndex = ctExplorer1.trAddPictureNode("资金资源优化", 0, 3, 9, 0, 0)
  54. ctExplorer1.trNodeCargo(intIndex) = "U3"
  55. intIndex = ctExplorer1.trAddPictureNode("人力资源优化", 0, 3, 10, 0, 0)
  56. ctExplorer1.trNodeCargo(intIndex) = "U4"
  57. intIndex = ctExplorer1.trAddPictureNode("资源全局优化", 0, 3, 10, 0, 0)
  58. ctExplorer1.trNodeCargo(intIndex) = "U5"

  59. intIndex = ctExplorer1.trAddPictureNode("供应链管理(SCM)", 0, 2, 10, 0, 0)
  60. ctExplorer1.trNodeForeColor(intIndex) = RGB(110, 180, 20)
  61. ctExplorer1.trNodeCargo(intIndex) = "V"
  62. 'ctExplorer1.trNodeExpanded(intIndex) = True
  63. intIndex = ctExplorer1.trAddPictureNode("供应方", 0, 3, 3, 0, 0)
  64. ctExplorer1.trNodeCargo(intIndex) = "V1"
  65. intIndex = ctExplorer1.trAddPictureNode("生产商", 0, 3, 8, 0, 0)
  66. ctExplorer1.trNodeCargo(intIndex) = "V2"
  67. intIndex = ctExplorer1.trAddPictureNode("配货中心", 0, 3, 9, 0, 0)
  68. ctExplorer1.trNodeCargo(intIndex) = "V3"
  69. intIndex = ctExplorer1.trAddPictureNode("零售商", 0, 3, 10, 0, 0)
  70. ctExplorer1.trNodeCargo(intIndex) = "V4"
  71. intIndex = ctExplorer1.trAddPictureNode("消费者", 0, 3, 10, 0, 0)
  72. ctExplorer1.trNodeCargo(intIndex) = "V5"


  73. intIndex = ctExplorer1.trAddPictureNode("软件接口", 0, 2, 10, 0, 0)
  74. ctExplorer1.trNodeCargo(intIndex) = "X"
  75. 'ctExplorer1.trNodeExpanded(intIndex) = True
  76. intIndex = ctExplorer1.trAddPictureNode("软件接口", 0, 3, 3, 0, 0)
  77. ctExplorer1.trNodeCargo(intIndex) = "X1"


  78. intIndex = ctExplorer1.trAddPictureNode("消息中心", 0, 2, 10, 0, 0)
  79. ctExplorer1.trNodeCargo(intIndex) = "Y"
  80. 'ctExplorer1.trNodeExpanded(intIndex) = True
  81. intIndex = ctExplorer1.trAddPictureNode("消息管理", 0, 3, 3, 0, 0)
  82. ctExplorer1.trNodeCargo(intIndex) = "Y1"


  83. intIndex = ctExplorer1.trAddPictureNode("系统管理", 0, 2, 10, 0, 0)
  84. ctExplorer1.trNodeCargo(intIndex) = "Z"
  85. 'ctExplorer1.trNodeExpanded(intIndex) = True
  86. intIndex = ctExplorer1.trAddPictureNode("系统管理", 0, 3, 3, 0, 0)
  87. ctExplorer1.trNodeCargo(intIndex) = "Z1"
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-11-11 04:53 , Processed in 0.092337 second(s), 34 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表