protected override void OnPaint(PaintEventArgs e)
{
ButtonBorderStyle leftStyle = m_borderStyle;
ButtonBorderStyle topStyle = m_borderStyle;
ButtonBorderStyle rightStyle = m_borderStyle;
ButtonBorderStyle bottomStyle = m_borderStyle;
base.OnPaint(e);
Rectangle borderRect = new Rectangle();
borderRect = this.DisplayRectangle;
Brush bgBrush = new SolidBrush(this.BackColor);
// Draw background and border
e.Graphics.FillRectangle(bgBrush,this.DisplayRectangle);
if (this.Style == MozPaneStyle.Vertical)
{
if (IsVerticalScrollBarVisible())
{
topStyle = ButtonBorderStyle.None;
bottomStyle = ButtonBorderStyle.None;
}
}
else
{
if (IsHorizontalScrollBarVisible())
{
leftStyle = ButtonBorderStyle.None;
rightStyle = ButtonBorderStyle.None;
}
}
ControlPaint.DrawBorder(e.Graphics,borderRect ,
m_borderColor,1,leftStyle, // left
m_borderColor,1,topStyle, // top
m_borderColor,1,rightStyle, // right
m_borderColor,1,bottomStyle); //bottom
// clean up
bgBrush.Dispose();
}