Multiple selection in a TreeView

走远了吗. 提交于 2019-12-05 08:53:33

This is not going to be easy to do with a standard WinForms TreeView control. The TreeView control only supports single selection per tree. It is not possible to simultaneously select multiple nodes in the tree.

In order to get this behavior you would likely end up needing to create a very similar class to TreeView which allowed for multiple selection. Another option is to derive from TreeView and enable multiple selection by overriding specific behaviors. Here is an article on how to do the latter.

Consider implementing multiple selection in a control that supports multiple selection like listview. If you follow standards that most Windows users understand you'll end up with a solution that is easier to implement and easier to use.

If you really need something more elaborate you might need to consider developing a custom control.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!