Passing message/progress back to the calling form

B

Bill Nguyen

Please help me to accomplish this.
I would like to create a sub/function that will display info & progress from
a called routine on the calling Form as follow.
Thanks a million.

Bill
---------------


Form1:

label1
progresssbar1

call Module1.Dotask()


Module1:

Function Dotask()

For each record

do something

send data back to Form1..label1
show progress on Form1.progressbar1

next

end function
 
R

Robin Tucker

Not a good idea to do things this way as your main form (Form1) won't get a
chance to repaint properly in order to display progress. What you need is
to perform the task on a thread and use delegates to fire progress "events"
to the form.
 
B

Bill Nguyen

Robin;

I'm new to .NET. Can you please elaborate and point me to some sample codes?

Thanks
Bill
 

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

Top