注册 登录
编程论坛 ASP.NET技术论坛

初学,向大家请教一个问题,谢谢啦!

liuhongyu 发布于 2007-06-29 10:12, 499 次点击

我的程序可以运行,但按钮的Click事件无响应,关闭窗体后显示的调试结果如下:
“DefaultDomain”: 已加载“c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll”,未加载符号。
“WindowsApplication1”: 已加载“C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\WindowsApplication1\WindowsApplication1\bin\Debug\WindowsApplication1.exe”,符号已加载。
“WindowsApplication1.exe”: 已加载“c:\windows\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll”,未加载符号。
“WindowsApplication1.exe”: 已加载“c:\windows\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll”,未加载符号。
“WindowsApplication1.exe”: 已加载“c:\windows\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll”,未加载符号。
程序“[692] WindowsApplication1.exe”已退出,返回值为 0 (0x0)。

代码如下:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WindowsApplication1
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}

/// <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()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(232, 88);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(96, 32);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(1008, 557);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
}

}
}

4 回复
#2
liuhongyu2007-06-29 11:56
很急啊!没有牛人解释一下吗?我要疯了
#3
bygg2007-06-29 12:25

一句语句都出错...这样的没遇见过...看一下是不是其它的错误吧,比如环境..

[此贴子已经被作者于2007-6-29 12:26:31编辑过]

#4
liuhongyu2007-06-29 22:14
回复:(bygg)一句语句都出错...这样的没遇见过...看...
我也怀疑是环境的问题,不知道怎么解决,电脑里东西太多了,谢谢你啊!
#5
yms1232007-06-29 23:06
private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
//这句话只在服务器端运行,理论上讲是影响不到客户端的浏览器。
}
1