关于C#的 error CS0123: No overload for 'PaintHandler1' matches delegate 'System.Windows.Forms.PaintEven
来源:互联网 发布:淘宝查购买顺序 编辑:程序博客网 时间:2024/06/06 08:30
public static void Main()
{
Form1 form = new Form1();
form.Text = "Two Paint Handlers";
form.BackColor = Color.White;
form.Paint += new PaintEventHandler(PaintHandler1);
form.Paint += new PaintEventHandler(PaintHandler2);
Application.Run(form);
}
static void PaintHandler1(Object objSender, PaintEventHandler pea)
{
Form1 form = (Form1)objSender;
Graphics grfx = pea.Graphics;
grfx.DrawString("First Paint Event Handler", form.Font, Brushes.Black, 0, 0);
{
Form1 form = new Form1();
form.Text = "Two Paint Handlers";
form.BackColor = Color.White;
form.Paint += new PaintEventHandler(PaintHandler1);
form.Paint += new PaintEventHandler(PaintHandler2);
Application.Run(form);
}
static void PaintHandler1(Object objSender, PaintEventHandler pea)
{
Form1 form = (Form1)objSender;
Graphics grfx = pea.Graphics;
grfx.DrawString("First Paint Event Handler", form.Font, Brushes.Black, 0, 0);
}
写代码的时候敲出了如下的错误,error CS0123: No overload for 'PaintHandler1' matches delegate 'System.Windows.Forms.PaintEven
发现具体原因是因为滥用代码补全,把PaintEventArgs 敲成了 PaintEventHandler
正确写法:
static void PaintHandler1(Object objSender, PaintEventArgs pea)
阅读全文
0 0
- 关于C#的 error CS0123: No overload for 'PaintHandler1' matches delegate 'System.Windows.Forms.PaintEven
- No overload for 'OnStartup' matches delegate 'System.Windows.StartupEventHandler'
- "error: Error retrieving parent for item: No resource found that matches" 错误的解决方法
- 关于.net中使用System.Windows.Forms.Timer的限制.
- 关于C#的delegate
- Android 应用出错 error: Error retrieving parent for item: No resource found that matches the的第二种情况
- Android 应用出错 error: Error retrieving parent for item: No resource found that matches the的第二种情况
- System.Windows.Forms.DataGridView的使用总结
- System.Windows.Forms.Timer定时器的“自毁”
- System.Windows.Forms.Cursor
- c#使用Windows.Forms里面计时器和System.Timers里面的计时器
- error: Error retrieving parent for item: No resource found that matches the given name 'android:Wind
- error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCo
- Android应用出错 error: Error retrieving parent for item: No resource found that matches the
- error: Error retrieving parent for item: No resource found that matches the given name 'android:Them
- 解决error: Error retrieving parent for item: No resource found that matches the given name 'AppCompat'
- 解决error: Error retrieving parent for item: No resource found that matches the given name 'android:
- error: Error retrieving parent for item: No resource found that matches the given name 解决方法1
- python爬虫中文输出问题以及不即时输出问题
- maven的阿里镜像
- Could not read from System Tables. You must grant SELECT access on all system tables for the databas
- python使用xlwt和xlrd模块操作excel
- Re-ID:AlignedReID: Surpassing Human-Level Performance in Person Re-Identification 论文解析
- 关于C#的 error CS0123: No overload for 'PaintHandler1' matches delegate 'System.Windows.Forms.PaintEven
- 普及练习场 字符串处理 斯诺登的密码
- Android EventBus
- struts2面试题
- 开发中常用Content-Type
- JSONObject 与JSONArray
- 创建邻接矩阵和邻接链表
- 欢迎使用CSDN-markdown编辑器
- 数据库事务的基本概念