Menu

#11 Background Color

open
nobody
None
5
2008-05-14
2008-05-14
No

The background of the DockPanel is control is not changeable.

Changing line 622 from
g.FillRectangle(SystemBrushes.AppWorkspace, ClientRectangle);
to
g.FillRectangle(new SolidBrush(BackColor), ClientRectangle);

Corrects the behavior.

@@ -619,7 +619,7 @@
base.OnPaint(e);

Graphics g = e.Graphics;
- g.FillRectangle(SystemBrushes.AppWorkspace, ClientRectangle);
+ g.FillRectangle(new SolidBrush(BackColor), ClientRectangle);
}

internal void AddContent(IDockContent content)

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Explicitly instantiated brushes should be disposed after use.

     
  • hag2k

    hag2k - 2008-08-11

    Logged In: YES
    user_id=1309113
    Originator: NO

    Should be changed to

    using (Brush brush = new SolidBrush(BackColor))
    {
    g.FillRectangle(brush, ClientRectangle);
    }

    otherwise the gdi object might not be released correctly.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.