日期:2014-05-20  浏览次数:20835 次

借个地方发个帖。。已经找到问题所在了。。

public class Father
    {
        protected bool focus = false;
        public void SetFocus(bool fo)
        {
            this.focus = fo;
        }
        private Child _child;

        public Child Child
        {
            get
            {
                if (_child == null)
                {
                    return new Child();
                }
                return _child;
            }
            set
            {
                if (_child == null)
                {
                    _child = new Child();
                }
                _child = value;
            }
        }

    }
    public class Child : Father
    {
        public bool GetFoucValue()
        {
            return base.focus;
        }
    }


   private void button1_Click(object sender, EventArgs e)
        {
            //Child child = new Child();
            //child.SetFocus(true);
            //bool oo = child.GetFoucValue();
            Father father = new Father();
            father.SetFocus(true);
            bool err = father.Child.GetFoucValue();
        }
C# oo

------解决方案--------------------
关乎人类未来文明的代码???
------解决方案--------------------
引用:
always i don't know what do you say!but i'm feel it's very powerful!

你怎么叫弦弦呢?这个是我的小名