I have a button click event and inside I do a lot of work.
While I am doing this work (not from the UI project) I want to send messages to the UI to display to the user.
I am doing something like:
void Button_Click(object sender, EventArgs e)
{
DoMyWork(SendMessage);
{
public void SendMessage(string message)
{
TextBox1.Text = message + "\n";
}
and inside DoMyWork which is in another assembly i can call SendMessage which writes to the textbox. The messages will only display though when DoMyWork is complete.
How can I update TextBox1.Text on the fly without putting DoMyWork on a BackGround thread or do i have to put it on a BackGround thread? I do actually want to block the user from doing anything while DoMyWork is running
thanks