Brent,
In this case, you will have to perform your work on another thread.
Then, as you want to update the UI, you would make calls to set the
appropriate UI elements.
Windows controls are picky about the context in which they are called,
though. Generally, anything affecting the UI has to be called from the
thread that created the UI itself. If you try and make a call to update the
text of a textbox from another thread, it won't work too well.
To get around this, you can create a delegate which matches the
signature of a method which will perform the update. You then pass this
delegate, along with any parameters to a call to Invoke on a control created
on the UI thread. It will then cause the method pointed to by the delegate
to be called on the UI thread.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Brent" <""b b i g l e r \"@ y a h o o . c o m"> wrote in message
news:11*************@corp.supernews.com...
I've never really done a form-based application -- I've mostly done Web
stuff -- so I have a very basic question:
How do I provide simple text feedback to the user as the program runs?
I'm envisioning some kind of Response.Write(), Response.Flush() scenario,
except that the text will go to a control on the form, rather than back to
the browser. I've tried a multiline textbox, and a label control, but in
each instance, the code has to finish executing before anything is
displayed.
I appreciate your help!
--Brent