下面程序错误提示“未定义程序入口点”,我是个菜鸟,别笑我
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace WindowsApplication2
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
this.Text ="hello world";
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
}
#endregion
private void Form1_Load(object sender, System.EventArgs e)
{
}
}
}
问题点数:20、回复次数:3Top
1 楼kwklover(随风)回复于 2004-05-02 14:48:12 得分 10
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
加上上面这端,但一个应用程序只能有一个入口点,就是只有一个窗体有上面那一端代码
一般新添加的窗体是没有上面那一段代码的,自己加上吧
Top
2 楼q7a(wy)回复于 2004-05-02 14:56:19 得分 5
主要原因是没有主函数即main函数Top
3 楼chenyuming2004(这辈子我算是废了)回复于 2004-05-02 15:09:35 得分 5
少了Main函数,
把
kwklover(随风)
的那段代码粘贴进去就可以了。Top




