标签:des style blog http color os io for
TreeView keep selected node highlighted
public QualityCheck() { InitializeComponent(); //trvIndexName.HideSelection = false; //trvIndexName.SelectedNode.BackColor = Color.BlueViolet; // cause DLL problem trvIndexName.DrawMode = TreeViewDrawMode.OwnerDrawAll; trvIndexName.DrawNode += new DrawTreeNodeEventHandler(trvIndexName_DrawNode); } void trvIndexName_DrawNode(object sender, DrawTreeNodeEventArgs e) { if (((e.State & TreeNodeStates.Selected) != 0) && (!trvIndexName.Focused)) e.Node.ForeColor = Color.Blue; else e.DrawDefault = true; } private void trvIndexName_BeforeSelect(object sender, TreeViewCancelEventArgs e) { if (trvIndexName.SelectedNode != null) trvIndexName.SelectedNode.ForeColor = Color.Black; e.Node.ForeColor = Color.Blue; }
TreeView Class Kek Points,布布扣,bubuko.com
标签:des style blog http color os io for
原文地址:http://www.cnblogs.com/kevinygq/p/3891920.html