Click here to Skip to main content
15,881,631 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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?
Posted
Updated 3-Dec-11 14:55pm
v2
Comments
[no name] 3-Dec-11 20:56pm    
EDIT: added code block

1 solution

You can use the sealed modifier (as described here[^]) in your custom control.
 
Share this answer
 
Comments
fadi77_net 3-Dec-11 13:25pm    
Sorry, but I am vb.net programmer
[no name] 3-Dec-11 20:57pm    
Then use NotInheritable instead?
fadi77_net 4-Dec-11 2:08am    
I don't want to use NotInheritable (vb.net) or Sealed (C#) key words, because if you have class A, and class B that inherited from A but it is NotInderitable, that means no class can be inherited form B.
That is not what I want, I want to prevent the developer to see the UserControl events, properties or methods when he is in view code editor (the events combobox in code editor). I want to display my own events only, not the UserControl events.
Did you got my idea?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900