Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

Which event is firing after the form load event and before form shown event??

Like in asp.net after page load event page_prerender event is firing automatically ,like this in forms which event is firing after form load event and before form shown event???


Thanks in advance
Posted

The order in which the events occurs in Windows Forms application is explained here.
Order of Events in Windows Forms[^]
As can be seen from there the Form.Activated event occurs after the Form.Load event and before the Form.Shown event.
 
Share this answer
 
Comments
bhagirathimfs 4-May-12 2:21am    
Thanks
I want to hide the form but when i write
this.hide();
in Form load it is not working and when i write in Form.Activated than this form is showing for a moment and than hiding it self.

Where to write the hide command so that it will open directly the second form?
VJ Reddy 4-May-12 4:23am    
If you want to hide a form before it is even displayed, then what is the purpose of Form. If the second form is to be displayed directly without any interaction with UI of Form, then I think the design can be reviewed. The actual requirement is not clear from the question and from the above comment.
Thank you.
bhagirathimfs 4-May-12 4:44am    
Actually i have two forms .
1.Login Form
2.Notificaiton form.

when a user logged into the application and didn't logout and close the application than when he again run the application than it automatically open the notification form not the login form.

So when a user is not logged out and close the application than when he/she run the application again he/she should see the notification form.

i have written code for the above requirement given below....
string userName = string.Empty;
string tokenId = CheckIsLoggedUser(out userName);
//Check whether username and token id is valid or not.
if (tokenId != string.Empty && userName != string.Empty)
{
//Hide the current Form.
this.Hide();
//Created an object of GetNotificaiton From.
GetNotification showNotification = new GetNotification(tokenId, userName);
//show the GetnNotificaiton From.
showNotification.Show();
//Dispose the notify icon.
ntfyNotification.Dispose();
}
hi,
before the load event Constructor of that particular form will execute
and at the end Dispose() will execute

Mark as solved if got your solution
Thanks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900