vs太大了,只能利用notepad++来编写我的c#程序。
/*
*
* cmd /K cd /d $(CURRENT_DIRECTORY) & csc /t:winexe $(NAME_PART).cs & PAUSE & $(NAME_PART).exe & EXIT
*
*/
using System;
using System.Windows.Forms;
namespace MyForm{
class Program{
static void Main(){
Application.Run(new MainForm());
}
}
public class MainForm : Form {
#region 声明控件
Button btn1;
#endregion
public MainForm(){
#region 控件创建
btn1 = new Button();
#endregion
#region 控件设置
btn1.Text = "关于";
btn1.Click += btn1Click;
#endregion
#region 窗口设置
Text = "标题";
Controls.Add(btn1);
#endregion
}
void btn1Click(object obj, EventArgs e){
MessageBox.Show("关于...");
}
}
}
把 cmd /K cd /d $(CURRENT_DIRECTORY) & csc /t:winexe $(NAME_PART).cs & PAUSE & $(NAME_PART).exe & EXIT 拷到"运行"。
OK! 窗口做好了,展示一下: