Home All Groups Group Topic Archive Search About

Best way to check things in background in MDI window

Author
8 Sep 2006 5:31 PM
Tom
I have an MDI application in VB.NET. The main MDI window has a status
bar, and menu bar. Child MDI windows are opened via the menu on the
main MDI window.

Now, what I want to do is add code to the main MDI window so that,
every 'xxx' amount of minutes, it goes out and checks a database for
some information. Based on that info, it will update some panels on the
status bar. What is the best way to accomplish this, while still
leaving the MDI child windows running at peak efficiency? I know I
could just drop a timer onto the main MDI window, and set that to the
appropriate number of seconds; however, I don't know what effect
(performance wise) that would have on the other child MDI window
processing... Would it be better to use a delegate, or thread for this?
Which way would be the most efficient? Or is the easier way (i.e. a
timer) just a good?

Thanks.

Chimp (Tom)
--

Author
8 Sep 2006 6:40 PM
Miro
I would assume a Time is easier.  ( i am unsure what a delegate is ( still
new to vb ),
but Timer vs Thread,  Timer wins in my opinion in this case )

You still need to check ur data every so many minutes - a timer does that
for you

A timer runs in its own thread,

So basically by you creating your own thread and have its own "internal
timer" somehow to check
your database every so many minutes - you have just reprogrammed the timer.

M.



Show quoteHide quote
"Tom" <tom@nospam.com> wrote in message
news:eragvy20GHA.3656@TK2MSFTNGP04.phx.gbl...
>I have an MDI application in VB.NET. The main MDI window has a status
> bar, and menu bar. Child MDI windows are opened via the menu on the
> main MDI window.
>
> Now, what I want to do is add code to the main MDI window so that,
> every 'xxx' amount of minutes, it goes out and checks a database for
> some information. Based on that info, it will update some panels on the
> status bar. What is the best way to accomplish this, while still
> leaving the MDI child windows running at peak efficiency? I know I
> could just drop a timer onto the main MDI window, and set that to the
> appropriate number of seconds; however, I don't know what effect
> (performance wise) that would have on the other child MDI window
> processing... Would it be better to use a delegate, or thread for this?
> Which way would be the most efficient? Or is the easier way (i.e. a
> timer) just a good?
>
> Thanks.
>
> Chimp (Tom)
> --
>