TreeView选中节点失去焦点后颜色仍突出显示
public TestLoseFocus()
{
InitializeComponent();
}
private void treeView1_DrawNode(object sender, DrawTreeNodeEventArgs e)
{
e.DrawDefault = true; //我这里用默认颜色即可,只需要在TreeView失去焦点时选中节点仍然突显
}
private void TestLoseFocus_Load(object sender, EventArgs e)
{
treeView1.ExpandAll();
treeView1.HideSelection = false;
//自已绘制
this.treeView1.DrawMode = TreeViewDrawMode.OwnerDrawText;
//this.treeView1.DrawNode += new DrawTreeNodeEventHandler(treeView1_DrawNode);
}
作者:daigualu 发表于2017/4/26 14:48:29 原文链接
阅读:119 评论:0 查看评论