像MouseEventArgs这个类是不能被实例化和被继承的,提示错误"The type 'System.Windows.Input.MouseEventArgs' has no constructors defined"
请问,怎样可以使我们自己写的类达到上面的效果呢,谢谢

解决方案 »

  1.   

    把构造函数设置为private其他的方法不知道了
      

  2.   

    除了用private和sealed ,还有没有其他方法呢?
      

  3.   

    构造函数
    {
       throw new Exception("The type 'System.Windows.Input.MouseEventArgs' has no constructors defined");
    }
      

  4.   

    sealed class  是可以创建实例的,但不能被继承;
    用abstract修饰,不能创建实例,只能继承;另外,构造函数定义为private,也可以通过访问类的方法或属性创建实例的,单例模式就是这样;
    用static修饰不能创建实例.
      

  5.   

    final类 不能继承 不能实例化的  接口 抽象类  sealed不能被继承