BrightIdeasSoftware.TreeListView.TreeRenderer.DrawExpansionGlyphManual C# (CSharp) Method

DrawExpansionGlyphManual() protected method

Draw the expansion indicator without using styles
protected DrawExpansionGlyphManual ( Graphics g, Rectangle r, bool isExpanded ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
isExpanded bool
return void
            protected virtual void DrawExpansionGlyphManual(Graphics g, Rectangle r, bool isExpanded)
            {
                int h = 8;
                int w = 8;
                int x = r.X + 4;
                int y = r.Y + (r.Height / 2) - 4;

                g.DrawRectangle(new Pen(SystemBrushes.ControlDark), x, y, w, h);
                g.FillRectangle(Brushes.White, x + 1, y + 1, w - 1, h - 1);
                g.DrawLine(Pens.Black, x + 2, y + 4, x + w - 2, y + 4);

                if (!isExpanded)
                    g.DrawLine(Pens.Black, x + 4, y + 2, x + 4, y + h - 2);
            }