Question

I want to create a control MessageProvider just like ErrorProvider..what I did is, created a class and inherited from ErrorProvider..

But now problem is, instead of SetError and GetError methods, I want to have SetMessage and GetMessage..and those SetError and GetError methods should not be part of MessageProvider class..

How can I create a new control MessageProvider?

Était-ce utile?

La solution

You could encapsulate the ErrorProvider within your new control.

Autres conseils

You cannot hide public methods from an inherited class as there is no private inheritance in the CTS. You can, however, easily add the SetMessage() and GetMessage() methods to your derived class and implement the desired functionality.

Your other option is to roll your own MessageProvider class that implements (mimics) only the desired functionality of ErrorProvider. This is probably more trouble than it's worth. I'd just derive and live with all the inherited functionality.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top