ARCed.Controls.CollapsibleGroupBox.DrawGroupBox C# (CSharp) Метод

DrawGroupBox() приватный Метод

private DrawGroupBox ( Graphics g ) : void
g Graphics
Результат void
        private void DrawGroupBox(Graphics g)
        {
            // Get windows to draw the GroupBox
            var bounds = new Rectangle(ClientRectangle.X, ClientRectangle.Y + 6, ClientRectangle.Width, ClientRectangle.Height - 6);
            GroupBoxRenderer.DrawGroupBox(g, bounds, Enabled ? GroupBoxState.Normal : GroupBoxState.Disabled);

            // Text Formating positioning & Size
            var sf = new StringFormat();
            int i_textPos = (bounds.X + 8) + this._mToggleRect.Width + 2;
            var i_textSize = (int)g.MeasureString(Text, Font).Width;
            i_textSize = i_textSize < 1 ? 1 : i_textSize;
            int i_endPos = i_textPos + i_textSize + 1;

            // Draw a line to cover the GroupBox border where the text will sit
            g.DrawLine(SystemPens.Control, i_textPos, bounds.Y, i_endPos, bounds.Y);

            // Draw the GroupBox text
            using (var drawBrush = new SolidBrush(Color.FromArgb(0, 70, 213)))
                g.DrawString(Text, Font, drawBrush, i_textPos, 0);
        }