Trouble understanding threads in .NET

dalangalma

Newcomer
Joined
Jun 18, 2003
Messages
1
I have an application I've written in C#. When you click one of the buttons,
it goes into a very long function that locks up the program for quite a while.
I'd really like to run that function in a thread and update my interface
controls to show the status of how far it's gotten. I just don't know how
to get the function to run in a new thread, and how to communicate between
that thread and the main user interface components. In other words, I need
to know:

1) How do I pass parameters into my function when I start it as a thread?

2) How do I communicate with things like textboxes, statusbars, and progressbars
as my function chugs along, to reassure the user that the program is, in
fact, doing something?

Any help on this topic would be appreciated.
 
Back
Top