程序出现参数有冲突 各位指点一下解决方法
发布时间:2011-06-28 14:06:23 文章来源:www.iduyao.cn 采编人员:星星草
程序出现参数有冲突 各位指点一下
下面是一个简单c#程序 但不知怎么出现参数冲突 软件没有给位置给我 不知在何处 怎样改 好晕
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace windows_表单
{
public partial class myfirstwinform: Form
{
public myfirstwinform()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{}
private System.Windows.Forms.Label mytextlabel;
private System.Windows.Forms.Button mycancelbutton;
public myfirstwinform()
{
//创建对象
this.mytextlabel=new System.Windows.Forms.Label();
this.mycancelbutton=new System.Windows.Forms.Button();
this.Text="我的表单";
//设置标签
this.mytextlabel.Location=new System.Drawing.Point(18,24);
this.mytextlabel.Text="这是一个简单的windows表单";
this.mytextlabel.Size=new System.Drawing.Size(200,24);
//设置取消按钮
this.mycancelbutton.Location=new System.Drawing.Point(148,200);
this.mycancelbutton.Size=new System.Drawing.Size(112,24);
this.mycancelbutton.Text="取消";
//设置事件
mycancelbutton.Click+=new EventHandler(mycancelbutton_Click);
//添加控件
this.AutoScaleDimensions=new System.Drawing.Size(5,12);
this.ClientSize=new System.Drawing.Size(200,200);
this.Controls.Add(this.mycancelbutton);
this.Controls.Add(this.mytextlabel);
}
//退出事件
public static void main()
{
Application.Run(new myfirstwinform());
}
private void button1_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
------解决方案--------------------
两个缺省构造函数
public myfirstwinform()
{
InitializeComponent();
}
public myfirstwinform()
{
//创建对象
this.mytextlabel=new System.Windows.Forms.Label();
this.mycancelbutton=new System.Windows.Forms.Button();
this.Text="我的表单";
//设置标签
this.mytextlabel.Location=new System.Drawing.Point(18,24);
this.mytextlabel.Text="这是一个简单的windows表单";
this.mytextlabel.Size=new System.Drawing.Size(200,24);
//设置取消按钮
this.mycancelbutton.Location=new System.Drawing.Point(148,200);
this.mycancelbutton.Size=new System.Drawing.Size(112,24);
this.mycancelbutton.Text="取消";
//设置事件
mycancelbutton.Click+=new EventHandler(mycancelbutton_Click);
//添加控件
this.AutoScaleDimensions=new System.Drawing.Size(5,12);
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
C#项目中如何更改项目保存的文件夹名?
求解。。
------解决方案--------------------
好像需要重构吧,同样求高人解答。
------...
-
C#中让TextBox只能输入数字的问题
我用的如下的代码:
static private Regex r = new Regex("^[0-9]{1,}$ ");
...
-
带数据库的程序打包注意什么?
打的包出错:Error:System.InvalidOperationException: ExecuteReader 要求已打开且可用的连接。连接的...
-
想学习一下网络程序开发 请给推荐几本书
学习基于http协议的程序开发 比如获取网页 分析网页 模拟网页操作 下载上传文档等知识 ...
-
qq的安装包是用什么工具?
想用.net制作一个想qq一样比较漂亮的安装包。有例子最好
------解决方案--------------------
新建->安...
-
C# 写的windows服务 调用 C++ dll 的问题
我封装了一个dll
用一个普通的winform程序 调用的时候没 问题。
但是放在C#写的服务程...
-
在VS2005中怎么调出 解决方案 那个图标?(图示)求解释~~~
这是我用的VS
这是我在教学视频上看到的VS
------解决方案------------...
-
寻友
有人在自学c#编程吗,可以互相认识一下,以后共同探讨学习中的问题……
------解决方案--------------------
朋友多了,路好走~
...
-
急!急!急!C#代码
怎样将数据库中的数据动态加载到Treeview控件中
------解决方案--------------------
C# code
void CreateTree(T...
-
救急??????????????????
哪位高手帮我一下,在C#中怎么写关于鼠标和键盘监听事件,我的程序就差监听鼠标和键盘是否动,然后定时关机这个功能了,请高手指点,...