我在父類寫了一個(gè)屬性 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; } }我在其他類中調(diào)用 Child child = new Child(); MessageBox.Show(child.Text)這時(shí)候,我在除vista,Win7的系統(tǒng)上測(cè)試,都可以正常顯示Text的值。但是在vista,Win7測(cè)試,具體跟蹤的時(shí)候,查看Text的值,會(huì)出現(xiàn)cannot be used in this context because it lacks the get accessor。但是執(zhí)行是沒問題的。不知道是什么原因,Anyone can help me?
關(guān)于在 vista,Win7上屬性重寫的問題
慕的地8271018
2018-11-05 05:07:51