Tag: ownerdrawn

TreeView通过某些节点删除checkbox

我想删除Node.Type是5或6的CheckBoxes。我使用这个代码: private void TvOne_DrawNode(object sender, DrawTreeNodeEventArgs e) { int type = (e.Node as Node).typ; if (type == 5 || type == 6) { Color backColor, foreColor; if ((e.State & TreeNodeStates.Selected) == TreeNodeStates.Selected) { backColor = SystemColors.Highlight; foreColor = SystemColors.HighlightText; } else if ((e.State & TreeNodeStates.Hot) == TreeNodeStates.Hot) { backColor = SystemColors.HotTrack; foreColor = SystemColors.HighlightText; } […]