日期:2014-05-17 浏览次数:20972 次
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void drawClock()
{
Graphics graphic = this.CreateGraphics();
Rectangle rect = new Rectangle(30, 76, 180, 180);
graphic.Clear(Color.White);
Pen myPen = new Pen(Color.Black, 1);
graphic.DrawEllipse(myPen, rect.Width / 2, rect.Height / 2, 180, 180);//画表盘
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
drawClock();
}
}
}
------解决方案--------------------