Thanx, I think you are right and I would give the same answer to myself :-)
But I can not rethink of the other design........
I have no access to the Code of Class A !
That's the Problem.........
Well, and now ?
I thought about hiding Property/Function/Sub/Event via Attributes.
The Problem is that I can only hide the the ones of Class B
and even if i shadowing the Properties of A in B they are not hidden.
I have tried these Attributes:
<ComponentModel.EditorBrowsable(ComponentModel.Edi torBrowsableState.Never),
ComponentModel.Browsable(False),
ComponentModel.DesignerSerializationVisibility(Com ponentModel.DesignerSerial
izationVisibility.Hidden)> _
Seams the only solution is to shadow it and set it obsolete
and fire an error if somebody using it.
But that's not very nice......
My UserControl for example has no Click Event...........
But the Windows.Forms.UserControl has it.........
Any many other useless Properties that nobody neads and confusing my
Customers using my Control.......
Should I rebuild the Class "Windows.Forms.UserControl" myself ?
Is this possible ? And How ?
Thanx anyway :-)
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb im Newsbeitrag
news:ef**************@TK2MSFTNGP11.phx.gbl...
* "Captain Chaos" <no****@nospam.com> scripsit: I have a class B that has inherited a class A.
In Class A there is a Property/Function/Sub/Event implemented
that i do not want to see if using Class B.
Is it possible to remove some Properties/Function/etc
without having access to Class A ?
That's breaking the inheritance hierarchy and it's not possible.
Something which is inherited, will be available in all subclasses. You
will have to rethink the design of your class hierarchy.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>