iam looking for code snippet or a sample of drawing background image for a
c# treeview control.
I tried following but i could not see the tree nodes only the ellipse shows
up.
TIA
public class xtree : System.Windows.Forms.TreeView
{
public xtree()
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.SupportsTransparentBac kColor,
false);
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
base.OnPaintBackground(pevent);
pevent.Graphics.DrawEllipse(pen, 0, 0, this.Width - 1, this.Height - 1);
}
}
}