Click here to Skip to main content
15,945,939 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I've created a form and i want my code to run automatically when form opens.

Better, I open the form and the code begins to run.

I've tried putting the code in Form_load function but in here the code starts but the form isn't shown

I'm using visual c++ 2010
Posted
Updated 3-Sep-11 2:41am
v4
Comments
Sergey Alexandrovich Kryukov 15-Mar-13 14:13pm    
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership.
Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
—SA

1 solution

So you mean that you want to run the code after the form is shown. In that case try using Shown[^] event.

However not that the UI will not be responding to user actions unless you run the code in another thread.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900