对OnPaint重写自动绘制扇形图像

  protected override void OnPaint(PaintEventArgs e)
        {

            Graphics g = e.Graphics;
            using (Pen bluepen = new Pen(Color.Red, 1))
            {
                if (ClientRectangle.Height / 20 > 10)
                {
                 
                    for (int y = 0; y < ClientRectangle.Height; y += ClientRectangle.Height / 10)
                    {
                        g.DrawLine(bluepen, new Point(0, 0), new Point(ClientRectangle.Width, y));
                      
                    }
                }
            }
        }

 

 

 

本文出自 “稻草人的技术家园” 博客,转载请与作者联系!

你可能感兴趣的:(职场,休闲,OnPaint,扇形图像)