Hi Jacek,
Thank you for posting in the community!
Based on my understanding, you want to be notified when any window in your
application is showing.
=============================
I think the problem depends on who will be notified when the window is
showing. (Can you tell me this?)
I think in the main form, you may want to show some forms. Then you want
your main form to be notified when these forms are showing.
Normally, you should passing the main form's reference to child form
class(You may add this parameter in child form's constructor). Then in the
child form's Load event, you can manipulate the Main Form(This is some kind
of notification).
Like this:
//Create a customized child form's constructor
Form mainform;
public Form2(Form f)
{
this.mainform=f;
}
// In the Main Form, show up the child form
Form2 f;
private void button_Click(object sender, System.EventArgs e)
{
f=new Form2(this);
f.Show();
}
When the Form2(child form) is showing, it will change the Caption text of
MainForm
=============================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.