怎么判断Treeview.Nodes是否存在 一个Node

薛峰1688 2008-08-09 11:00:22
我在Vb.net中,需要判断Treeview中是否包含一个Node我的代码如下:
Dim ndroot1 As TreeNode = New TreeNode("Level 1")

Call TreeView1.Nodes.Add(ndroot1)
If TreeView1.Nodes.ContainsKey("Level 1") Then
Text:
Dim a As Integer = 0
End If

好像就是不会走到Text这一行 ,谢谢 !!!!
...全文
225 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
akenny0423 2008-08-19
  • 打赏
  • 举报
回复
因该递归
LYDF4151 2008-08-18
  • 打赏
  • 举报
回复
上面写错了点,因该使用递归方法遍历所有节点。
LYDF4151 2008-08-18
  • 打赏
  • 举报
回复
TreeView1.Nodes指根节点集合,你所找的节点不在此节点里,
所以没走到 Text

因该该为 Treeview1.nodes(false)
ming4066 2008-08-09
  • 打赏
  • 举报
回复
up
一、简介 通过这个课程带大家从零开发一款功能全面的后台管理系统,包括项目搭建、功能实现到最后的Linux系统部署全过程。本课程使用SpringMVC + Spring + Mybatis作为主体框架,使用AdminLTE作为前端框架,使用主流关系型数据库Mysql作为存储数据库,使用非关系型数据库Redis作为缓存数据库,并集成SpringSecuriy安全框架做权限的动态管理,集成Swagger2自动生成接口文档,集成Druid连接池进行SQL性能监控,集成ActiveMQ消息中间件进行异步解耦,提高性能。最后使用linux系统进行服务部署,并搭建nginx反向代理服务器提高网站性能。 二、学习目标 通过本课程的学习带大家掌握SSM框架的开发流程,并熟练使用SpringSecurity做为安全框架进行权限管理,整合相关优秀的开源框架进行功能开发。还在项目中带大家学习前端相关的Jquery、Bootstrap等知识。课程结束之后希望大家能做到独立进行开发项目的目的,增强解决问题的能力,具备功能落地实现的能力。 三、课程涉及知识点 SpringMVC源码分析Mybatis源码分析通用MapperMysql数据库Redis缓存实现ActiveMQ消息中间件SpringSecurity鉴权Swagger2接口文档生成自定义注解AOP切面编程自定义过滤器Logback日志整合Druid性能监控Linux系统Nginx反向代理Ajax异步请求技术Jquery基本使用AdminLTE前端框架Chart图表-线状图和饼状图百度地图定位城市BootStrap前端框架BootStrap-Table插件BootStrap-Treeview插件Markdown编辑器403、404、500错误页面配置数据库事务消息提示插件toastr.js图片上传插件bootstrap fileinput数字滚动效果pv/uv流量统计...四、课程部分内容截图如下 1、首页 2、菜单管理 3、图床管理 4、图标管理 5、留言反馈管理 6、druid监控 7、登录日志
V6.6 (04 Apr 2017) * Fixed issue #705: Added support for RAD Studio 10.2 Tokyo * Fixed issue #702: Access Violation at designtime when RootNodeCount is >0 * Fixed issue #703: Possibly wrong selection if nodes are selected during DeleteChildren() * Fixed issue #700: If the user clicked a node, we are no longer centering this node if the option toCenterScrollIntoView is set. * Fixed issue #691: When the user uses Cursor-Left/Right, the Virtual TreeView should perform horizontal scrolling if there is no other operation * Fixed issue #699: TVTColors.GetColor: Honor user defined colors also when StyleServices are enabled (Thx to luebbe for PR) * Fixed issue #698: Horizontal scrollbar may not update when turning on or off columns * Fixed issue #350: TVirtualTreeColumn.fLeft should be in protected part * Fixed issue #312: When unfocusing a node while the Spacebar is still pressed, the check state should be toggled * Fixed issue #161: Shift+End does not work as expected with toGridExtension + toFullRowSelect options set * Fixed issue #697: OnChange not fired when unselecting nodes * Fixed issue #692: HitInfo for OnNodeClick event may differ much from HandleMouseDown * Fixed issue #687 by extracting new method DeleteNodes() from existing DeleteSelectedNodes(). * Fixed issue #689: Possible Integer overflow in PaintColumnHeader() when dragging a column to first position. * Fixed issue #693: TVirtualTreeAccessibility.accSelect() should handle the flag SELFLAG_EXTENDSELECTION * Fixed issue #690: Tree shouldn't keep selected elements, if toAlwaysSelectNode is set and other elements are selected without ctrl-modifier * Improved non-breaking implementation of #622: The deprecated property CheckImageKind is no longer written to DFM files, but read properly from old DFMs. Thx to the-Aroich for providing it. * Some minor tweaks on Virtual TreeView source code and sample projects

16,552

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧