删除蓝色选择,单击树视图? [英] Removing blue selection click the treeview?

查看:90
本文介绍了删除蓝色选择,单击树视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

我在C#中的项目上有一个树形视图,但有一个我会更改的问题.我不知道如何删除当我们双击树状视图中的节点时出现的蓝色背景,如下图所示:

图像

有什么办法可以消除这个蓝色背景?

谢谢.

Hello people.

I have a treeview on a project in C # and I have a problem that I would change. I wonder how to remove that blue background that appears when we double click on a node in the treeview as image below:

Image

Is there any way to remove this blue background?

Thanks.

推荐答案

向您的TreeView添加BeforeSelect事件:

Add a BeforeSelect event to your TreeView:

treeView1.BeforeSelect += new TreeViewCancelEventHandler(treeView1_BeforeSelect);



并创建一个treeView1_BeforeSelect函数:



And create a treeView1_BeforeSelect function:

private void treeView1_BeforeSelect(object sender, TreeViewCancelEventArgs e)
        {
            e.Cancel = true;
        }




您只会得到蓝色背景直到1秒钟,但背景是白色.




You''ll only get the blue background until 1 second, but then the background is white.


您也可以使用

As alternative, you can use

node.checked = false



以及



as well


这篇关于删除蓝色选择,单击树视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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