AnimatGuiCtrls.Controls.ComboTreeBox.OnPaintContent C# (CSharp) Method

OnPaintContent() protected method

Paints the selected node in the control.
protected OnPaintContent ( DropDownPaintEventArgs e ) : void
e DropDownPaintEventArgs
return void
        protected override void OnPaintContent(DropDownPaintEventArgs e)
        {
            base.OnPaintContent(e);

            Image img = GetNodeImage(selectedNode);
            string text = (selectedNode != null) ? ((showPath) ? Path : selectedNode.Text) : nullValue;

            Rectangle imgBounds = (img == null) ? new Rectangle(1,0,0,0) : new Rectangle(4, e.Bounds.Height / 2 - img.Height / 2, img.Width, img.Height);
            Rectangle txtBounds = new Rectangle(imgBounds.Right, 0, e.Bounds.Width - imgBounds.Right - 3, e.Bounds.Height);

            if (img != null) e.Graphics.DrawImage(img, imgBounds);

            TextRenderer.DrawText(e.Graphics, text, Font, txtBounds, ForeColor, TEXT_FORMAT_FLAGS);

            // focus rectangle
            if (Focused && ShowFocusCues && !DroppedDown) e.DrawFocusRectangle();
        }