title: Load vs. Shown events in Windows Forms
body: <p>Hopefully I'm just missing something obvious, but I'm trying to get my head around the differences between the Load and the Shown events in <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="noreferrer">Windows Forms</a>.</p>
  
  <p>Traditionally, I've only used Load (or actually OnLoad, since I think it's cleaner to override a method than to rely on the designer to hook up an event on yourself), since that is available in all versions of .NET. With .NET 2.0 the Shown event was introduced.</p>
  
  <p>Now, if you look at the descriptions for these in the MSDN documentation ("Load: Occurs before a form is displayed for the first time.", "Shown: Occurs whenever the form is first displayed.") it <em>sounds</em> like the Load event should occur, then the form should become visible, then the Shown event should occur; the combination of the two thereby letting you carry out some tasks both before and after the form is visible. Makes sense, right?</p>
  
  <p>However, experimentation has shown that the Shown event invariably occurs <em>before</em> the Load event, whenever I try it (and both occur before the form becomes visible). And yet, when I google around whenever I discover a page that talks about the order these events are fired in, they always list the Load event being fired first.</p>
  
  <p>Am I just going crazy, or have I missed something? (And if they do occur at about the same time, then why was the Shown event added in the first place?)</p>
  
  <p>(My current solution for doing something both before and after showing the form is to use OnLoad for the "before showing" stuff and start a short-duration one-shot timer for the "after showing" stuff. Which works OK and reliably, but it's a bit ugly and I was hoping there was a cleaner solution. But it looks like the Shown event isn't it.)</p>