I have a TreeView that allows users to select certain elements of hierarchical data by checking or un-checking each item\'s checkbox. Currently I disable the box on nodes th
This code might help you if you are thinking of drawing the mixed checkbox
class MixedCheckBox:Control
{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
CheckBoxRenderer.DrawCheckBox(e.Graphics, new Point(0, 0), Bounds,
Text, Font, false,
System.Windows.Forms.VisualStyles.CheckBoxState.MixedNormal);
}
}
This will render:
Good luck!
There is now a neat looking solution at Code Project, Tri-State Tree View
I'm just researching at the moment, so haven't yet used it.
Have you taken a look at this? It seems to do the job. It might be a bit dated, (looks like the article is from 2004), but I'm sure the same principles can be extended to whatever you need to do.