如何在树视图中仅选择子节点 [英] how to select only childe nodes in treeview

查看:100
本文介绍了如何在树视图中仅选择子节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是Windows应用程序.我使用treeview来显示文本和日期.文本将显示在父节点中,日期将显示在子节点中.

Q-如何限制用户仅选择日期而不选择文本?

我尝试在
中进行编码

It is windows application. I used treeview to display text and date. Text will appear in parent node and date will appear in child node.

Q - How to restrict user to choose only date not text ?

I tried coding in

private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
}


推荐答案

所有树视图组件均旨在允许选择任何节点.即使您可以设法限制某些节点,也只会使用户感到困惑.这只是一个坏主意.您需要检查您的UI设计.如果要限制某些节点的选择,为什么要显示该节点呢?不要试图做这不自然的事情,最好回顾一下设计.总是有可能的.

—SA
All tree view components are designed to allow selection of any node. Even if you could manage to restrict some nodes, it could only confuse the user. This is just a bad idea. You need to review your UI design. If you want to restrict selection of some node, why would you show this node at all? Don''t try to do this unnatural thing, better review the design. It''s always possible.

—SA


这篇关于如何在树视图中仅选择子节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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