By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,640 Members | 1,331 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,640 IT Pros & Developers. It's quick & easy.

VB.net run code on form open

P: n/a
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????

Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
tr******@centatek.com wrote:
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
Nov 21 '05 #2

P: n/a
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

<tr******@centatek.com> schreef in bericht
news:11*********************@f14g2000cwb.googlegro ups.com...
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????

Nov 21 '05 #3

P: n/a
sorry, about this but i am a beginner on vb.net, how do i launch a new
thread to do the code?

Nov 21 '05 #4

P: n/a
That i understand! I had tried activated, but it restarted with each
mouse click.

Nov 21 '05 #5

P: n/a
And did you direct write that code in that event, that I gave you?

Cor
Nov 21 '05 #6

P: n/a
<tr******@centatek.com> schrieb:
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/microsoft.public.dotnet.languages.vb/browse_frm/thread/b1bee1c40ec9133c/>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.