Home All Groups Group Topic Archive Search About

How to pass a form control to a class for updating

Author
4 Apr 2006 2:13 PM
timc_fla
Ok, here's the scenario:

I have a form with a status bar on it.
I have a class that does a LOT of processing.
I want to update the status bar text property periodically from within the
class by passing a reference of the status bar to the class.

In VB6 this is pretty straightforward, but I just can't seem to get it
figured out in vb.net.
Should I be trying to do it this way in .net or what?

Can anyone help me?

Author
4 Apr 2006 1:25 PM
Chris
timc_fla wrote:
> Ok, here's the scenario:
>
> I have a form with a status bar on it.
> I have a class that does a LOT of processing.
> I want to update the status bar text property periodically from within the
> class by passing a reference of the status bar to the class.
>
> In VB6 this is pretty straightforward, but I just can't seem to get it
> figured out in vb.net.
> Should I be trying to do it this way in .net or what?
>
> Can anyone help me?

If you want to have the UI update while doing a cpu intensive job you
should launch the job in a worker thread.  You can then use a delegate
to update your status bar.

http://abstractvb.com/code.asp?A=1027

Chris
Author
4 Apr 2006 4:18 PM
timc_fla
Chris wrote:
>> Ok, here's the scenario:
>>
>[quoted text clipped - 8 lines]
>>
>> Can anyone help me?
>
>If you want to have the UI update while doing a cpu intensive job you
>should launch the job in a worker thread.  You can then use a delegate
>to update your status bar.
>
>http://abstractvb.com/code.asp?A=1027
>
>Chris

Cool!
It's not really a CPU intesive job but SQL intensive.
Get records, processing them and outputting a text file, bascially.
I want to provide some sort of feedback so the user knows the app is working.
So, if I understand the example correctly, it appears that class Counter will
be my class and everything else should fall into place with a few simple
changes?