我在父类写了一个属性 private string m_Text = "abc"; public virtual string Text { get { return m_Text; } set { m_Text = value; } }在子类重写 public override string Text { set { base.Text = value; } }我在其他类中调用 Child child = new Child(); MessageBox.Show(child.Text)这时候,我在除vista,Win7的系统上测试,都可以正常显示Text的值。但是在vista,Win7测试,具体跟踪的时候,查看Text的值,会出现cannot be used in this context because it lacks the get accessor。但是执行是没问题的。不知道是什么原因,Anyone can help me?
- 2 回答
- 0 关注
- 387 浏览
添加回答
举报
0/150
提交
取消