public static event Eventhandler TestOY
        {
            add
            {
                TestOY += value;
            }
            remove
            {
                TestOY -= value;
            }
        }

解决方案 »

  1.   

     public static event Eventhandler TestOY
            {
                add
                {
                    TestOY += value;
                }
                remove
                {
     TestOY -= value;            }
    去看下有关事件的东西。最好查下MSDN。
      

  2.   

    定义事件
    public static event Eventhandler TestOY
            {
    添加事件
                add
                {
                    TestOY += value;
                }
    移除事件
                remove
                {
                    TestOY -= value;
                }
            }
      

  3.   

    以前没见过
    附加事件 和 移出事件 中的Add 和 Remove 是编译器帮我们写的吧?
    public static event Eventhandler TestOY; 这是定义一个事件对象
    定义完后 
    就可以 TextOY+=  TextOY-=
    不用我们写Add Remove
      

  4.   

    就像其他用属性包装一样,你可以增加操作。public static event Eventhandler TestOY
            {
                add
                {
                    TestOY += value;
                    MessageBox.Show("New eventhandler add.");
                }
                remove
                {
                    TestOY -= value;
                    MessageBox.Show(value.GetMethod().Name + " is removed from event list.");
                }
            }