Is it possible to display the output in a single line by updating the percentage of a check disk progress in the same line. For example, if I want to show a percentage of a check disk progress, as of now in my output it shows in new line for every step of output.I'd just like to update the percentage of it in the same line , and not have to put each percentage on a new line. Stage 1: Examining basic file system structure ... Progress: 0 of 120832 done; Stage: 0%; Total: 0%; ETA: 0:05:50 Progress: 1238 of 120832 done; Stage: 1%; Total: 0%; ETA: 0:05:50 Progress: 3585 of 120832 done; Stage: 2%; Total: 1%; ETA: 0:05:47 Progress: 6798 of 120832 done; Stage: 5%; Total: 1%; ETA: 0:00:58 this is how i get the output which is queried in a string and displayed on a textbox control
private void button1_Click(object sender, EventArgs e) { String cmd = textBox1.Text; if (cmd == "") { MessageBox.Show("Please Enter a command!", "Input error"); return; } richTextBox1.Text = "Executing...\n"; ExecuteCmd exe = new ExecuteCmd(); exe.TestEvent += Exe_TestEvent; String result = exe.ExecuteCommand(cmd); } private void Exe_TestEvent(string s) { if (richTextBox1.InvokeRequired) { richTextBox1.Invoke(new MethodInvoker(delegate { richTextBox1.Text += s + Environment.NewLine; richTextBox1.SelectionStart = richTextBox1.Text.Length; richTextBox1.ScrollToCaret(); })); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)