I have a UserControl
.
I want each UserControl
to Override an Abstract method.
This is my abstract class:
public class MyAbstract
{
public virtual void LoadData()
{
}
}
This my usercontrol with my latest attempt at getting this to work:
public partial class ucAbstract : UserControl, MyAbstract
{
public ucAbstract()
{
InitializeComponent();
}
public override void LoadData()
{
base.Load();
{
}
}
}
The error is:
Class 'ucAbstract' cannot have multiple base classes: 'UserControl' and 'MyAbstract'
How can I do this?
ADDITIONAL: I may have to remove this addition and create a new question.
This is what I am trying to achieve:
My main form contains 2 UserControls
: ucOne
, ucTwo
Both of these controls have a method called 'LoadData'.
I have a function in my main form:
void LoadControl(iuserControl myUserControl)
{
myUserControl.LoadData();
}