Click here to Skip to main content
Sign Up to vote bad
good
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 3 Dec '11 - 6:50
Edited 3 Dec '11 - 14:55

Comments
Eduard Lu - 3 Dec '11 - 20:56
EDIT: added code block

1 solution

You can use the sealed modifier (as described here[^]) in your custom control.
  Permalink  
Comments
fadi77_net - 3 Dec '11 - 13:25
Sorry, but I am vb.net programmer
Eduard Lu - 3 Dec '11 - 20:57
Then use NotInheritable instead?
fadi77_net - 4 Dec '11 - 2:08
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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Arun Vasu 394
1 OriginalGriff 370
2 Sergey Alexandrovich Kryukov 313
3 Tadit Dash 213
4 Maciej Los 191
0 Sergey Alexandrovich Kryukov 9,955
1 OriginalGriff 7,589
2 CPallini 4,028
3 Rohan Leuva 3,422
4 Maciej Los 2,949


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 3 Dec 2011
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid