Form Events
-
Hi All, I'm having some problems finding the correct Forms event from which to fire my code. I want to run a sequence of code automatically once a form is displayed on the screen. Form_load isn't correct as my code finished before the form is displayed. Form_Shown doesn't seem to trigger consistently. Form_Activated triggers multiple times Form_Validated doesn't seem to trigger consistently. What event should i use? I basically want the code to fire as if the form was displayed on the screen and I hit a "Start Button". Thanks in advance. Daniel.
-
Hi All, I'm having some problems finding the correct Forms event from which to fire my code. I want to run a sequence of code automatically once a form is displayed on the screen. Form_load isn't correct as my code finished before the form is displayed. Form_Shown doesn't seem to trigger consistently. Form_Activated triggers multiple times Form_Validated doesn't seem to trigger consistently. What event should i use? I basically want the code to fire as if the form was displayed on the screen and I hit a "Start Button". Thanks in advance. Daniel.
Shown should fire exactly once, the first time the form has become visible. MSDN: "Occurs whenever the form is first displayed." :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.