I have something like this :
public class WinformBase : Winform
{
public WinformBase (){
this.Activated += new System.EventHandler(this.MyTest1_Activated);
}
private void MyTest1_Activated(object sender, EventArgs e)
{
MyController.TopFormActivated(this);
}
}
public class MyForm : WinformBase
{
public MyForm (){
this.Activated += new System.EventHandler(this.MyTest2_Activated);
}
private void MyTest2_Activated(object sender, EventArgs e)
{
MyController.TopFormActivated(this);
}
}
The problem is that the event is only triggered in MyForm and not in the Winform base?
Why is that so, and how can I have the event triggered in WinformBase
too?
This is my solution to the problem :
public class WinformBase : Winform
{
public WinformBase (){
}
protected override void OnActivated(EventArgs e)
{
base.OnActivated(e);
Controller.MyMethod();
}
}
public class MyForm : WinformBase
{
public MyForm (){
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With