Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In what order do .NET Windows forms events fire?

I notice that there are a number of different events I can capture when I'm working with a Windows Form in .NET (or any other control, for that matter) - on opening, there's:

  • Load
  • Activated
  • Shown
  • VisibleChanged

And when closing, there's:

  • Leave
  • FormClosed
  • FormClosing
  • Disposed

Plus any others I've missed. I know I could put a messagebox in each event, and then run my application and write down the order, but I doubt I'll remember it.

Is there a reference online that lists the -order- in which these events occur, for Forms and other controls? I can't find it on MSDN, though maybe I've missed it somewhere.

like image 630
SqlRyan Avatar asked Dec 02 '22 07:12

SqlRyan


1 Answers

This is one of the relevant pages on MSDN :

http://msdn.microsoft.com/en-us/library/86faxx0d.aspx

like image 147
MartW Avatar answered Dec 22 '22 09:12

MartW