Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Form Events

Status
Not open for further replies.

danielkelly

IS-IT--Management
Aug 13, 2006
28
AU
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.
 
then the Form.Load event would work. Now if you want this to run in the background while the screen is displayed that another matter.

Research the BackgroundWorker class. This is probably the quickest solution to implement.

However if this is truely an asynchronous process you may want to look at messaging. there are 3 frameworks which support this:
NServiceBus
Rhino.ServiceBus
MassTransit


Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top