private void frmMain_SizeChanged(object sender, EventArgs e) { Graphics g = this.pictureBox1.CreateGraphics(); g.Clear(Color.White); Clock clock = new Clock(); clock.OnStart(g, pictureBox1.Width / 2, pictureBox1.Height / 2); timer1.Tick += new EventHandler(Draw); }
public void pictureBox1_Click(object sender, EventArgs e) {//画表盘 Graphics g = this.pictureBox1.CreateGraphics(); g.Clear(Color.White); Clock clock = new Clock(); clock.OnStart(g, pictureBox1.Width / 2, pictureBox1.Height / 2); timer1.Tick += new EventHandler(Draw); }