Code run when form shown ?

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2005
Posts: 181
Reputation: Paul.Esson is an unknown quantity at this point 
Solved Threads: 10
Paul.Esson's Avatar
Paul.Esson Paul.Esson is offline Offline
Junior Poster

Code run when form shown ?

 
0
  #1
Jun 3rd, 2005
I was wondering if there is anyway to make Windows Forms do certain tasks whenever its shown ?

- Thanks in advance Paul
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 5
Reputation: Abyss is an unknown quantity at this point 
Solved Threads: 0
Abyss Abyss is offline Offline
Newbie Poster

Re: Code run when form shown ?

 
0
  #2
Jun 7th, 2005
You can always add timer which starts when form activates.

On timer event should contain what tasks form should do.
Reply With Quote Quick reply to this message  
Join Date: Jul 2003
Posts: 117
Reputation: Iron_Cross is an unknown quantity at this point 
Solved Threads: 2
Iron_Cross's Avatar
Iron_Cross Iron_Cross is offline Offline
Junior Poster

Re: Code run when form shown ?

 
0
  #3
Jun 14th, 2005
Actually what you should do is add an event handler to either the Load event or the VisibleChanged event. It all depends on if you want the code to execute everytime the form is shown, or only the first time the form is shown.
Obviously, use Load if you only want the code to execute the first time. Use VisibleChanged if you want the code to execute everytime the form is shown.
elitehackers.info
Today's Penny-Arcade!
Pain is weakness leaving the body!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum


Views: 6024 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC