c#中的程序报错
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
namespace mYproject
{
/// <summary>
/// Window1.xaml 的交互逻辑
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
label1.Text = "Hello,World!";
}
private void button2_Click(object sender, RoutedEventArgs e)
{
}
}
}
错误 1 “System.Windows.Controls.Label”不包含“Text”的定义,并且找不到可接受类型为“System.Windows.Controls.Label”的第一个参数的扩展方法“Text”(是否缺少 using 指令或程序集引用?) D:\projects\mYproject\mYproject\Window1.xaml.cs 30 20 mYproject