- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace WindowsApplication2
- {
- public partial class Form4 : Form
- {
- public Form4()
- {
- InitializeComponent();
- }
- bool drawElipse = false;
- private void button1_Click(object sender, EventArgs e)
- {
- this.drawElipse = !this.drawElipse;
- using (Graphics g = this.CreateGraphics())
- {
- if (this.drawElipse)
- {
- g.FillEllipse(Brushes.DarkBlue, this.ClientRectangle);
- }
- else
- {
- g.FillEllipse(SystemBrushes.Control, this.ClientRectangle);
- }
- }
- }
- private void Form4_Load(object sender, EventArgs e)
- {
- }
- }
- }
c#绘制椭圆
最新推荐文章于 2024-07-02 16:17:35 发布