星空网 > 软件开发 > ASP.net

Winform中Treeview控件失去焦点,将选择的节点设置为高亮显示 (2012

Winform中Treeview控件失去焦点,将选择的节点设置为高亮显示 (2012-07-16 13:47:07)转载▼
标签: winform treeview drawnode
Treeview控件--Name:tVtypeList
将tVtypeList的HideSelection属性设置为False,DrawMode属性设置为OwnerDrawText
将tVtypeList的DrawNode事件写为:
private void tVtypeList_DrawNode(object sender, DrawTreeNodeEventArgs e)
{
e.Graphics.FillRectangle(Brushes.White, e.Node.Bounds);
if (e.State == TreeNodeStates.Selected)//做判断
{
e.Graphics.FillRectangle(Brushes.Blue, new Rectangle(e.Node.Bounds.Left, e.Node.Bounds.Top, e.Node.Bounds.Width, e.Node.Bounds.Height));//背景色为蓝色
e.Graphics.DrawString(e.Node.Text, tVtypeList.Font, Brushes.White, e.Bounds);
//字体为白色
}
else
{
e.DrawDefault = true;
}
}
分享:




原标题:Winform中Treeview控件失去焦点,将选择的节点设置为高亮显示 (2012

关键词:ie

ie
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

关于素质拓展的活动:https://www.vstour.cn/t/关于素质拓展的活动.html
关于拓展公司:https://www.vstour.cn/t/关于拓展公司.html
关于拓展活动:https://www.vstour.cn/t/关于拓展活动.html
关于拓展活动的建议:https://www.vstour.cn/t/关于拓展活动的建议.html
关于拓展培训:https://www.vstour.cn/t/关于拓展培训.html
关于拓展训练:https://www.vstour.cn/t/关于拓展训练.html
珠海长隆横琴剧院在哪里?附禁带物品:https://www.vstour.cn/a/334173.html
珠海长隆横琴剧院坐公交怎么去:https://www.vstour.cn/a/334174.html
相关文章
我的浏览记录
最新相关资讯
跨境电商服务平台 | 深圳旅行社 | 东南亚物流