protected void PaintNormalState(Graphics g)
{
int X = this.Width - 1;
int Y = this.Height - 1;
int radius = Y;
GraphicsPath path = new GraphicsPath();
path.AddArc(X - radius, 0, radius, radius, 270, 90);
path.AddArc(X - radius, Y - radius, radius, radius,0,90);
path.AddArc(0, Y - radius , radius, radius, 90, 90);
path.AddArc(0, 0, radius, radius, 180, 90);
path.CloseFigure();
Rectangle newRect = new Rectangle(ClientRectangle.X + 1,
ClientRectangle.Y + 1,
ClientRectangle.Width - 2,
ClientRectangle.Height - 2);
brush = new LinearGradientBrush(newRect,
m_color1,
m_color2,
mode);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.CompositingQuality = CompositingQuality.GammaCorrected;
g.FillPath(brush, path);
g.DrawPath(new Pen(m_color2, 1), path);
path.Dispose();
brush.Dispose();
}
protected void PaintHoverState(Graphics g)
{
int X = this.Width - 1;
int Y = this.Height - 1;
int radius = Y;
GraphicsPath path = new GraphicsPath();
path.AddArc(X - radius, 0, radius, radius, 270, 90);
path.AddArc(X - radius, Y - radius, radius, radius,0,90);
path.AddArc(0, Y - radius , radius, radius, 90, 90);
path.AddArc(0, 0, radius, radius, 180, 90);
path.CloseFigure();
Rectangle newRect = new Rectangle(ClientRectangle.X + 1,
ClientRectangle.Y + 1,
ClientRectangle.Width - 2,
ClientRectangle.Height - 2);
brush = new LinearGradientBrush(newRect,
m_color2,
m_color1,
mode);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.CompositingQuality = CompositingQuality.GammaCorrected;
g.FillPath(brush, path);
g.DrawPath(new Pen(m_color2, 1), path);
path.Dispose();
brush.Dispose();
}
protected void PaintClickedState(Graphics g)
{
int X = this.Width - 1;
int Y = this.Height - 1;
int radius = Y;
GraphicsPath path = new GraphicsPath();
path.AddArc(X - radius, 0, radius, radius, 270, 90);
path.AddArc(X - radius, Y - radius, radius, radius,0,90);
path.AddArc(0, Y - radius , radius, radius, 90, 90);
path.AddArc(0, 0, radius, radius, 180, 90);
path.CloseFigure();
Rectangle newRect = new Rectangle(ClientRectangle.X + 1,
ClientRectangle.Y + 1,
ClientRectangle.Width - 2,
ClientRectangle.Height - 2);
brush = new LinearGradientBrush(newRect,
m_color2,
m_color2,
mode);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.CompositingQuality = CompositingQuality.GammaCorrected;
g.FillPath(brush, path);
g.DrawPath(new Pen(m_color2, 1), path);
path.Dispose();
brush.Dispose();
}