I want to have an abstract UserControl , BaseControl , which implements the IBaseControl interface. However, setting the class for abstract breaks is VisualStudio Designer (this is a known issue with Visual Studio (for example, see https://stackoverflow.com/questions/890189/ ... for more information), and as far as I know, expected changes are not expected there soon
So, to get around this, I am making BaseControl not abstract, but its implementation of the IBaseControl methods virtual. However, since these methods do not make sense for BaseControl (for example, not all components have been added yet), I force them to throw:
public class BaseControl : UserControl, IBaseControl {
In the derived control, I have a corresponding override:
public partial class DerivedControl : BaseControl { public override void LoadSettings() {
Despite this, when I try to open the control in the constructor, I get an error message indicating that BaseControl.LoadSettings exception.
Now remember that LoadSettings is called in the base class, so when the constructor loads DerivedControl , it in turn calls the load method for BaseControl , which throws.
Are you having a similar problem? How did you deal with this? I would like to have an elegant solution, if possible.