VB.net run code on form open

  • Thread starter Thread starter traversd
  • Start date Start date
T

traversd

Hi there, this is driving me nuts!

i have a program that is to be run over night, no interaction from the
user. I want the code to start runing when the program is started, but
i also want to display a form, so we can see the progress (as it takes
a couple of hours to run).

If i put the code in form load i do not see the form, if i put the code
in a timer and run it after x amount of time, i can't debug it.

what is the best way of doing this????
 
Hi there, this is driving me nuts!

i have a program that is to be run over night, no interaction from the
user. I want the code to start runing when the program is started, but
i also want to display a form, so we can see the progress (as it takes
a couple of hours to run).

If i put the code in form load i do not see the form, if i put the code
in a timer and run it after x amount of time, i can't debug it.

what is the best way of doing this????


Launch a new thread to do your work in the Form_Load. This way your
work starts but the form_load thread still completes.

Chris
 
Treavers,

You mean that you want to set the code in the activated event of the form
instead of the load event?.
(And than start direct that event with to remove the handler from that)

RemoveHandler Me.Activated, AddressOf Form1_Activated

I hope this helps,

Cor
 
sorry, about this but i am a beginner on vb.net, how do i launch a new
thread to do the code?
 
That i understand! I had tried activated, but it restarted with each
mouse click.
 
And did you direct write that code in that event, that I gave you?

Cor
 
i have a program that is to be run over night, no interaction from the
user. I want the code to start runing when the program is started, but
i also want to display a form, so we can see the progress (as it takes
a couple of hours to run).

If i put the code in form load i do not see the form, if i put the code
in a timer and run it after x amount of time, i can't debug it.

See (complete thread):

<URL:http://groups.google.de/group/micro...guages.vb/browse_frm/thread/b1bee1c40ec9133c/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top