I am new to C# windows forms and I have question about firing an event in a user control and handle it in another form.
I have Form1
, Form2
and UserControl1
.
Form2
is shown using showdialog()
from Form1
and the UserControl1
is added in Form2
.
There is an event in UserControl1
I want to handle in Form1
. I know to do this Form1
subscribes to an event in Form2
and Form2
subscribes to an event in UserControl1
and when the UserControl1
event gets fired it is handled in Form2
and then Form2
fires its event and this is handled in From1
.
But I am looking for different approach. I want to fire event from UserControl1
straight to From1
and handle it in From1
without Form2
intervention.