C#的初级程序调试问题 :当前上下文中不存在名称“label1”
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Da...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MyProject
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "Hello, World!";
}
}
}
编译时他提示:错误 1 当前上下文中不存在名称“label1” C:\Documents and Settings\wwj\Local Settings\Application Data\Temporary Projects\MyProject\Form1.cs 20 13 MyProject 展开
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MyProject
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "Hello, World!";
}
}
}
编译时他提示:错误 1 当前上下文中不存在名称“label1” C:\Documents and Settings\wwj\Local Settings\Application Data\Temporary Projects\MyProject\Form1.cs 20 13 MyProject 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询