手机
当前位置:查字典教程网 >编程开发 >C#教程 >C#处理Paint事件的方法
C#处理Paint事件的方法
摘要:本文实例讲述了C#处理Paint事件的方法。分享给大家供大家参考。具体方法如下:usingSystem;usingSystem.Collec...

本文实例讲述了C#处理Paint事件的方法。分享给大家供大家参考。具体方法如下:

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 Form5 : Form { bool drawElipse = false; public Form5() { InitializeComponent(); this.SetStyle(ControlStyles.ResizeRedraw, true); } private void Form5_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { this.drawElipse = !this.drawElipse; this.Invalidate(true); } private void Form5_Paint(object sender, PaintEventArgs e) { if (!this.drawElipse) return; Graphics g = e.Graphics; g.FillEllipse(Brushes.DarkBlue, this.ClientRectangle); } } }

希望本文所述对大家的C#程序设计有所帮助。

【C#处理Paint事件的方法】相关文章:

C#调用Java类的实现方法

C# 格式化字符首字母大写的方法

C# 抓取网页内容的方法

C# 打开电子邮件软件的具体方法

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

string类的使用方法详解

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

使用SmtpClient发送邮件的方法

C#中隐式运行CMD命令行窗口的方法

C# 向二进制文件进行读写的操作方法

精品推荐
分类导航