如何防止UserControl继承其对象的某些事件,方法和属性? [英] How to prevent UserControl to inherits some of its events, methods and properties to its object?
本文介绍了如何防止UserControl继承其对象的某些事件,方法和属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人
我正在创建一个数字文本框控件并将其命名为NumTextbox
,但是当我从中创建对象时,我在对象中看到了带有自定义事件的UserControl
事件,因此我想防止该对象继承UserControl
事件,方法和属性,我希望它仅继承我自己的.
有人可以帮我吗?
Dear all
I am creating a numerical text box control and named it NumTextbox
, but when I create an object from it, I saw the UserControl
events in the object with my custom events, so I want to prevent the object to inherits the UserControl
events, methods and properties, I want it to inherits my own only.
Can anybody help me please?
推荐答案
您可以使用sealed
修饰符(如 ^ ]).
You can use the sealed
modifier (as described here[^]) in your custom control.
这篇关于如何防止UserControl继承其对象的某些事件,方法和属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文