检查节点的类型是父节点还是子节点并获取文本 [英] Check the type of node whether it is parent or child and get the text

查看:101
本文介绍了检查节点的类型是父节点还是子节点并获取文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我在窗口应用程序中有一个具有两个级别的树视图控件(仅限父级和子级),我想检查是检查父节点还是节点节点类型

这里的父节点可能不止一个,每个父节点也包含不止一个子节点.

如果父节点被选中,那么我要获取所有选中的父节点文本,如果子节点被选中,则要获取所有父节点中所有选中的子节点文本.

请帮助我,

在此先谢谢您.

 如果(nd.Nodes.Count ==  0 )
            // 子节点
            其他
            // 父节点 



希望对您有帮助


Hi friends,

I have tree view control having two level (parent & Child only) in window application i want to check which type of node is checked whether it parent or node

here parent node may be more then one and each parent node contain also more than child.

if the parent node is checked then i want to get all checked parent node text and if child node checked then want to get all checked child node text in all parent node.

please help me,

Thanks in advance.

解决方案

If I get your question right ... if you wish to know the node is a parent just check the nodes property of a treenode like,

if (nd.Nodes.Count == 0)
            //child node
            else
            //parent node



hope that helps


这篇关于检查节点的类型是父节点还是子节点并获取文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆