Perhaps I understand what you mean, but this doesn't "disable" calling SelectedIndexChanged event. It seems that it is not possible to do, what I want and that it is not correct in OOP principles. Bobo
bobo jede
Posts
-
Hide an event in an inherited class -
Hide an event in an inherited classJ4amieC wrote:
Yes, write your own control, rather than inheriting ComboBox.
Yes, that can be a way :) but I want to use this control and it's rich functionality.
J4amieC wrote:
Quite simply, no it is not. Inheritance implies that the derived object inherits every public property/method/event from its parent.
But I can do the same with methods, don't I ?! Bobo
-
Hide an event in an inherited classYou mean Obsolete attribute? I've tried it, but it didn't help :( Thanx for your answer Bobo
-
Hide an event in an inherited classHi, I have an interesting problem (interesting for me :)). I need to hide an event in an inherited class. Example: Base class: ComboBox Inherited class: MyCombo And I want the event
SelectedIndexChanged
to be "disabled" out of MyCombo class. So that it shloud be impossible to write:MyCombo mc = new MyCombo(); mc.SelectedIndexChanged += new EventHandler(mc_SelectedIndexChanged);
I tried this:**private new** event EventHandler SelectedIndexChanged;
but it doesn't work - it is still possible to use this event. Is there any way to do this? And is it correct to do it in OOP? Thanx, Bobo