//-------------------------------------------- // Modified from DashedEllipse.cs © 2001 by Charles Petzold //-------------------------------------------- using System; using System.Drawing; using System.Windows.Forms; class DashedEllipse: Form { public new static void Main() { Application.Run(new DashedEllipse()); } public DashedEllipse() { Text = "Dashed Ellipse Using DrawArc"; } protected override void OnPaint(PaintEventArgs pea) { Graphics grfx = pea.Graphics; Color clr = ForeColor; int cx = ClientSize.Width; int cy = ClientSize.Height; Pen pen = new Pen(clr); Rectangle rect = new Rectangle(0, 0, cx - 1, cy - 1); for (int iAngle = 0; iAngle < 360; iAngle += 15) grfx.DrawArc(pen, rect, iAngle, 10); } }