c# - Is there any case in which the Form's Activated event is not raised? -


i don't understand why that, thought activated should raised when form shown. in fact form has toplevel set false , it's added form. when main form shows, it's visible, , can interact controls tested , saw activated not raised.

public mainform(){      initializecomponent();      form child = new form();      child.activated += (s,e) => {         messagebox.show("activated!");      };      child.size = new size(200,100);      child.toplevel = false;      child.show();      child.parent = this; } 

after running mainform child form appeared inside main 1 , there isn't messagebox displayed message "activated!".

what additional job make raise?

if second form comes screen first time, can use shown event.

activate event fired when form gets focus, not contain showing first time. but, if previous form active outside of app, not raise activate event. mean valid when viewing forms of same project.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -