Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with refreshing textbox

Status
Not open for further replies.

kokon

Programmer
Apr 27, 2006
31
0
0
PL
In the code below DayTicker is started by
Code:
timer1.Tick += new EventHandler(DayTicker);

Code:
void DayTicker(object sender, EventArgs e)
{
  timer1.Stop()
  richTextBox1.Text += "\nTESTTTTTTT\n";
  myProcess(0, 0, 0);
  CheckTheOutput();

Code:
public void myProcess(int first, int second, int third)
        {
            Process proc = new Process();
            proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            proc.StartInfo.CreateNoWindow = true;
            proc.StartInfo.UseShellExecute = false;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.StartInfo.FileName = "test.exe";

            proc.Start();

            StreamReader myStreamReader = proc.StandardOutput;
            OutputLog = myStreamReader.ReadToEnd();

            richTextBox1.Text += OutputLog;
           
            
     
        
        }

Process test.exe takes about 2 min to complete. And after that time textBox is updated with the text: "TEST" and test.exe output.
But text: "TEST" should appear before the execution of the process, not after proccess is ended.
Please help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top