public override void PaintThumb(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, eScrollThumbPosition position, eScrollBarState state) { Office2007ScrollBarStateColorTable ct = GetColorTable(state); if (ct == null) return; // Initialize Colors m_ThumbOuterBorder.Apply(ct.ThumbOuterBorder); m_ThumbSignFill.Apply(ct.ThumbSignBackground); m_ThumbSignShape.Path = GetThumbSignPath(position); m_ThumbShape.Paint(new Presentation.ShapePaintInfo(g, bounds)); m_ThumbSignShape.Path.Dispose(); m_ThumbSignShape.Path = null; }
public virtual void PaintThumb(Graphics g, System.Drawing.Rectangle bounds, eScrollThumbPosition position, eScrollBarState state) { }
private GraphicsPath GetThumbSignPath(eScrollThumbPosition pos) { GraphicsPath path = new GraphicsPath(); Size signSize = m_ThumbSignSize; if (pos == eScrollThumbPosition.Left || pos == eScrollThumbPosition.Right) { int w = signSize.Width; signSize.Width = signSize.Height; signSize.Height = w; } if (pos == eScrollThumbPosition.Top) { path.AddPolygon(new PointF[] {new PointF(-1, signSize.Height), new PointF(signSize.Width / 2 , -1), new PointF(signSize.Width / 2, -1), new PointF(signSize.Width, signSize.Height), new PointF(signSize.Width, signSize.Height), new PointF(-1, signSize.Height)}); path.CloseAllFigures(); } else if (pos == eScrollThumbPosition.Bottom) { path.AddLine(signSize.Width / 2, signSize.Height + 1, signSize.Width, 1); path.AddLine(signSize.Width, 1, 0, 1); path.AddLine(0, 1, signSize.Width / 2, signSize.Height + 1); path.CloseAllFigures(); } else if (pos == eScrollThumbPosition.Left) { //signSize.Width++; signSize.Height++; int h2 = (int)(signSize.Height / 2); path.AddLine(0, h2, signSize.Width, 0); path.AddLine(signSize.Width, 0, signSize.Width, signSize.Height); path.AddLine(signSize.Width, signSize.Height, 0, h2); path.CloseAllFigures(); } else if (pos == eScrollThumbPosition.Right) { signSize.Height++; path.AddLine(signSize.Width, signSize.Height / 2, 0, 0); path.AddLine(0, 0, 0, signSize.Height); path.AddLine(0, signSize.Height, signSize.Width, signSize.Height / 2); path.CloseAllFigures(); } return path; }