手机
当前位置:查字典教程网 >编程开发 >C#教程 >C#绘制椭圆的方法
C#绘制椭圆的方法
摘要:本文实例讲述了C#绘制椭圆的方法。分享给大家供大家参考。具体实现方法如下:usingSystem;usingSystem.Collectio...

本文实例讲述了C#绘制椭圆的方法。分享给大家供大家参考。具体实现方法如下:

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#程序设计有所帮助。

【C#绘制椭圆的方法】相关文章:

使用SmtpClient发送邮件的方法

C#给picturebox控件加图片选中状态的2个方法

C#计算代码执行时间的方法

解决C#全屏幕截图的实现方法

c#中分割字符串的几种方法

深入C# 内存管理以及优化的方法详解

C#中读写INI文件的方法例子

C#对XML文件的各种操作实现方法

C#操作config文件的具体方法

Winform跨线程操作的简单方法

精品推荐
分类导航