So I have been battling this issue for awhile now and tried many different ways to fix it but cannot.
Bascally waht my app does is calls a java file to load an applica
Trying moving the WaitForExit
call out of the UI thread.
As @M. Babcock mentioned, you are holding up updates to the rich text box.
A solution similar to this may work:
Modify btnLoad_Click
to start a new thread that processes the list (this goes in the count > 0 branch)
Thread thread = new Thread(new ThreadStart(LoadPbThread));
thread.Start();
Then, add this:
void LoadPbThread()
{
String toLoad;
for (int i=0; i < count;i++)
{//START OF FOREACH
toLoad = lstBarToLoad.Items[i].Text;
//call load method.
loaddPB(toLoad);
}//end of for.
}