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

#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#要注意大小写的!
温馨提示:答案为网友推荐,仅供参考
相似回答