在treeView中单击treeNode时如何更改HightLight颜色 [英] How to change the HightLight Color When a treeNode has been clicked in the treeView

查看:106
本文介绍了在treeView中单击treeNode时如何更改HightLight颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改treeView中的单击高光颜色",就像标题"一样.谢谢!

How to change the Click HightLight Color in the treeView,Just Like The Title . Thank You!

推荐答案

您必须自己绘制它.这是此MSDN页面关于主题的内容:
You''ll have to draw it yourself. Here is what this MSDN page says about the topic:
You can customize most of the TreeView colors by setting color properties,
but the selection highlight color is not available as a property.

但是,该页面还向您展示了如何自行定制绘制节点,甚至还专门显示了如何更改突出显示的节点的颜色.请注意,我对TreeView的使用非常有限...我在Google上找到了此信息... Google是您的朋友.不知道这次您是否很不幸,但是我建议您先在Google上问一下,然后再问问题.我只花了5分钟即可找到该信息(实际上,找到信息的时间更像是30秒,而查看它的时间更像是5分钟).想象一下,如果您学习如何使用Google,可以节省多少时间.

However, that page also shows you how to custom draw nodes yourself, and it even shows specifically how to change the color of the highlighted node. Note that my use of TreeView is very limited... I found this information with Google... Google is your friend. Not sure if you just got unlucky this time, but I suggest you Google a bit first before asking questions here. It only took me 5 minutes to find that information (actually, more like 30 seconds to find it and 5 minutes to review it). Imagine how much time you could save if you learn how to use Google.


您没有提到要为Winforms 还是Webforms进行此操作.如果用于网络,则可以使用适当的CSS进行此操作.

You didn''t mention if you want this for Winforms or for Webforms. If it is for web, you can use appropriate css to do this.

 使用
#a { color : red;}

您还可以使用CSS定制a:访问过的a:悬停等.


 Use
#a { color : red;}

You can also customize a:visited a:hover etc using css.



在网络表单中,我们可以添加TreeNode的客户端单击事件以更改其颜色
in webform, we can add TreeNode''s client click event to change its color


这篇关于在treeView中单击treeNode时如何更改HightLight颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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