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

Getting a timer tick to fire during a form load

P: n/a
Is there any way to accomplish this? The forms _Load event fires off
several other small ones that I'd like to track time for. I can't get
either the Mdi Parent form's timer _Tick event or the child form that I'm
opening's _Tick to actually fire off. Any help any of you gurus can give me
will be much appreciated :).

-Jayyde
Jul 19 '06 #1
Share this Question
Share on Google+
7 Replies

P: n/a
do you just want the form_load event to make other timers start?

private void Form1_Load(...)
{

Form2 frm = new Form2;

frm.Timer1.Start();

}
--
-iwdu15
Jul 19 '06 #2

P: n/a
Hi,

I'm not sure what you want, are you sauing that you create several other
forms (child form) in the form_load event and yuo want to know how long does
this take?

what is the use of the timer? , What timer are you using?
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Jayyde" <an**@hotmail.comwrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
Is there any way to accomplish this? The forms _Load event fires off
several other small ones that I'd like to track time for. I can't get
either the Mdi Parent form's timer _Tick event or the child form that I'm
opening's _Tick to actually fire off. Any help any of you gurus can give
me will be much appreciated :).

-Jayyde

Jul 19 '06 #3

P: n/a
Basically I have a grid that is loaded on it's form's load event. I have it
(in between certain lines of code) incrementing a progress bar on the mdi
container form. What I would like a timer control to do is up the progress
bar by 1 every time it ticks so the user still knows something is happening
during the lines of code that take forever in one call (such as the actual
getdataset() call). Unfortunately while lines of code such as that are
executing I can't get either the timer on the mdi container or the timer on
the form that is loading to fire. If that doesn't explain it well let me
know and I'll give it another whack...

Thanks :).

-Jayyde
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.uswrote
in message news:O4**************@TK2MSFTNGP04.phx.gbl...
Hi,

I'm not sure what you want, are you sauing that you create several other
forms (child form) in the form_load event and yuo want to know how long
does this take?

what is the use of the timer? , What timer are you using?
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Jayyde" <an**@hotmail.comwrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
>Is there any way to accomplish this? The forms _Load event fires off
several other small ones that I'd like to track time for. I can't get
either the Mdi Parent form's timer _Tick event or the child form that I'm
opening's _Tick to actually fire off. Any help any of you gurus can give
me will be much appreciated :).

-Jayyde


Jul 19 '06 #4

P: n/a
well it doesnt make sense to have a progressbar keep track of nothing, maybe
you should rethink ur UI....just my 2 cents, but show us your code and maybe
we can see whats going on
--
-iwdu15
Jul 19 '06 #5

P: n/a
Jayyde,
Take a look at the BackgroundWorker class, which is specifically designed to
help with this type of long running background thread and update the UI
situation:

http://msdn2.microsoft.com/en-us/lib...undworker.aspx

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jayyde" wrote:
Basically I have a grid that is loaded on it's form's load event. I have it
(in between certain lines of code) incrementing a progress bar on the mdi
container form. What I would like a timer control to do is up the progress
bar by 1 every time it ticks so the user still knows something is happening
during the lines of code that take forever in one call (such as the actual
getdataset() call). Unfortunately while lines of code such as that are
executing I can't get either the timer on the mdi container or the timer on
the form that is loading to fire. If that doesn't explain it well let me
know and I'll give it another whack...

Thanks :).

-Jayyde
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.uswrote
in message news:O4**************@TK2MSFTNGP04.phx.gbl...
Hi,

I'm not sure what you want, are you sauing that you create several other
forms (child form) in the form_load event and yuo want to know how long
does this take?

what is the use of the timer? , What timer are you using?
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Jayyde" <an**@hotmail.comwrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
Is there any way to accomplish this? The forms _Load event fires off
several other small ones that I'd like to track time for. I can't get
either the Mdi Parent form's timer _Tick event or the child form that I'm
opening's _Tick to actually fire off. Any help any of you gurus can give
me will be much appreciated :).

-Jayyde


Jul 19 '06 #6

P: n/a
Here's an example of what I'm talking about--and how it's not wanting to
keep track of nothing--it's just giving the user the impression that
something is still happening when I can't keep track of exactly how much is
getting done per amount of time manually--just a little fascade for them...

************CODE*****************
frmMain frmParent = (frmMain)this.TopLevelControl;

frmParent.SetProgressBarValue(50, true);

frmParent.SetStatusBarText("Retrieving Unmapped Product records...", true);

DataSet ds = boProductClientLoadView.GetDataSet();
************************************
frmParent.SetProgressBarValue(75, true);

frmParent.SetStatusBarText("Loading data into grid...", true);

ugUnmappedProducts.DataSource = ds.Tables[0];
**************************************

frmParent.SetProgressBarValue(100, true);

frmParent.SetStatusBarText("Complete.", true);

****************************************

The starred lines are examples of lines of code where work is being done by
the app, but I can't track it. So what I want to happen is have a timer
tick away every second or two and just jump that progress bar up 1% each
time so the user thinks/knows that SOMETHING is happening still. Otherwise
it kind of looks like the app just froze on 50% or 75% while it does its
thing.

To Peter:

That sounds like a brilliant plan and one that I would immediately try
to implement if we weren't still trying to talk the boss-man into plunking
down the extra coin to upgrade us from VS 2003 to 2005. Is there anything
that would accomplish the same thing in 2003?

Thanks :).

-Jayyde

"iwdu15" <jmmgoalsteratyahoodotcomwrote in message
news:0A**********************************@microsof t.com...
well it doesnt make sense to have a progressbar keep track of nothing,
maybe
you should rethink ur UI....just my 2 cents, but show us your code and
maybe
we can see whats going on
--
-iwdu15

Jul 20 '06 #7

P: n/a
Hi,

You have to use a backgound thread to do that.

Do a search by Control.Invoke and you will see a lot of post regarding this
problem
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Jayyde" <an**@hotmail.comwrote in message
news:OY****************@TK2MSFTNGP05.phx.gbl...
Basically I have a grid that is loaded on it's form's load event. I have
it (in between certain lines of code) incrementing a progress bar on the
mdi container form. What I would like a timer control to do is up the
progress bar by 1 every time it ticks so the user still knows something is
happening during the lines of code that take forever in one call (such as
the actual getdataset() call). Unfortunately while lines of code such as
that are executing I can't get either the timer on the mdi container or
the timer on the form that is loading to fire. If that doesn't explain it
well let me know and I'll give it another whack...

Thanks :).

-Jayyde
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:O4**************@TK2MSFTNGP04.phx.gbl...
>Hi,

I'm not sure what you want, are you sauing that you create several other
forms (child form) in the form_load event and yuo want to know how long
does this take?

what is the use of the timer? , What timer are you using?
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Jayyde" <an**@hotmail.comwrote in message
news:Oh**************@TK2MSFTNGP04.phx.gbl...
>>Is there any way to accomplish this? The forms _Load event fires off
several other small ones that I'd like to track time for. I can't get
either the Mdi Parent form's timer _Tick event or the child form that
I'm opening's _Tick to actually fire off. Any help any of you gurus can
give me will be much appreciated :).

-Jayyde



Jul 20 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.