943,923 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 8747
  • C# RSS
Jun 3rd, 2005
0

Code run when form shown ?

Expand Post »
I was wondering if there is anyway to make Windows Forms do certain tasks whenever its shown ?

- Thanks in advance Paul
Similar Threads
Reputation Points: 21
Solved Threads: 10
Junior Poster
Paul.Esson is offline Offline
181 posts
since Feb 2005
Jun 7th, 2005
0

Re: Code run when form shown ?

You can always add timer which starts when form activates.

On timer event should contain what tasks form should do.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Abyss is offline Offline
5 posts
since Jun 2005
Jun 14th, 2005
0

Re: Code run when form shown ?

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.
Reputation Points: 46
Solved Threads: 2
Junior Poster
Iron_Cross is offline Offline
117 posts
since Jul 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: how to get the folder list of client side?
Next Thread in C# Forum Timeline: Creating a GUI using C#





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC