星空网 > 软件开发 > 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 (#换成@)。

如何创建Facebook视频插播广告版位,打造品牌知名度?:https://www.ikjzd.com/articles/101836
干货:Shopee关键词广告的分析和使用技巧:https://www.ikjzd.com/articles/101840
亚马逊常用的几个收款平台介绍:https://www.ikjzd.com/articles/101841
教大家如何在速卖通开店,流程详解!:https://www.ikjzd.com/articles/101845
速卖通新手卖家店铺运营技巧:https://www.ikjzd.com/articles/101850
中美补贴之战迎来终局,中方可能申请报复授权!:https://www.ikjzd.com/articles/101854
沃尔玛推出全新数据分析服务,助力品牌推动销售:https://www.kjdsnews.com/a/1842113.html
北京城市图书馆公交地铁自驾路线:https://www.vstour.cn/a/407243.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流