c# 问题 应输入class,delegate,enum,interface或struct

来源:百度知道 编辑:UC知道 时间:2024/05/15 09:16:57
#region properties
public string text
{
Get{
return this.label1.Text;
}
set
{
this.label1.Text = value;
}
}
#endregion

错误信息:应输入class,delegate,enum,interface或struct
还是不行,是上面public string text 这句有问题

试试看!

public string text
{
get
{
return this.label1.Text;
}
set
{
this.label1.Text = value;
}
}

刚才测试了下

属性是类里面的!所以
不能够单独创建属性,必须
你试试看

class myabc
{
public string text
{
get
{
return this.label1.Text;
}
set
{
this.label1.Text = value;
}
}
}

共同学习!

c#要注意大小写的!