TreeView多项选择 [英] TreeView multiple selections

查看:66
本文介绍了TreeView多项选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




TreeView有多种选择方式吗?但是我不是在谈论它的复选框。$ / b

我想要一种类似于ListView的方式,MultiSelect = True。所以我可以使用

[Ctrl]或[Shift]键并单击以进行多项选择。然后当我

只需点击一个项目时,之前的所有选择都消失了。


提前致谢。


Li

Hi,

Is there a way for TreeView to have multiple selections? But I am not
talking about its checked boxes.

I want a way similar to ListView with MultiSelect = True. So I can use
[Ctrl] or [Shift] key and click to make multiple selections. Then when I
simply click one item, all previous selections are gone.

Thanks in advance.

Li

推荐答案

你好李,


是的,.Net TreeView控件没有通过

默认支持多项选择。我们通常为所有TreeNode启用复选框,这样我们可以使用CheckBox来指示多个选择。但是,如果你真的想要在TreeView中获得真正的多选功能,你必须自定义TreeView控件。
自定义TreeView控件。下面的文章提供了具有多个选择功能的TreeView的扩展版本


" C#TreeView with multiple selection"
http://www.codeproject.com/cs/miscctrl/treeviewms.asp

" Multi-Select TreeView"
http://windowsclient.net/downloads/f...entry1273.aspx

在C#中多选TreeView控件
http://www.codeproject.com/cs/miscctrl/mwcontrols.asp


希望这会有所帮助。


祝你好运,

Jeffrey Tan

Microsoft Online Community支持

========================================= =========

获取我的帖子通知通过邮件?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========

此帖子按原样提供。没有保证,也没有授予任何权利。

Hi Li,

Yes, the .Net TreeView control does not support multiple selection by
default. We normally enable checkbox for all the TreeNodes, so that we may
use CheckBox to indicate the multiple selection. However, if you really
wanted to get the true multiple selection function in TreeView, you have to
customize TreeView control. The articles below provide the extended version
of TreeView with multiple selection function:
"C# TreeView with multiple selection"
http://www.codeproject.com/cs/miscctrl/treeviewms.asp
"Multi-Select TreeView"
http://windowsclient.net/downloads/f...entry1273.aspx
"Multi-Select TreeView Control in C#"
http://www.codeproject.com/cs/miscctrl/mwcontrols.asp

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


你好李,


你有没有回复我对你的回复?这对你有意义吗?如果你仍然需要帮助,请随时提供反馈,谢谢。


祝你好运,

Jeffrey Tan

Microsoft在线社区支持

================================ ==================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========

此帖子按原样提供。没有保证,也没有授予任何权利。

Hi Li,

Have you reviewed my reply to you? Does it make sense to you? If you still
need any help, please feel free to feedback, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


杰弗里:


非常感谢你的帮助!

我已经阅读了你的回复,但没有机会阅读文章和

尝试一下。完成目前的工作后,我会这样做。


再次感谢。





"" Jeffrey Tan [MSFT]""写道:
Hi, Jeffrey:

Thanks a lot for the help!
I have read your response but haven''t got a chance to read the articles and
try them out. I will do that after I finish my current work.

Thanks again.

Li

""Jeffrey Tan[MSFT]"" wrote:

嗨李,


你有没有回复我的回复?这对你有意义吗?如果你仍然需要帮助,请随时提供反馈,谢谢。


祝你好运,

Jeffrey Tan

Microsoft在线社区支持

================================ ==================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========

此帖子按原样提供。没有保证,也没有授予任何权利。

Hi Li,

Have you reviewed my reply to you? Does it make sense to you? If you still
need any help, please feel free to feedback, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


这篇关于TreeView多项选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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