Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ActiveX User-controls VB.NET , +
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 7:50am
Edited 3-Dec-11 15:55pm
v2
Comments
Eduard Lu at 3-Dec-11 20:56pm
   
EDIT: added code block

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

  Print Answers RSS
0 OriginalGriff 539
1 Maciej Los 300
2 DamithSL 233
3 Sergey Alexandrovich Kryukov 209
4 BillWoodruff 200
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 3 Dec 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100