title: How to show performance counter results in texbox.text windows forms c#
body: <p>Hey guys I`m new to c# and I learned a lot from reading answers on this community.</p>
  
  <p>I`m trying to create a performance monitoring system
  I did through the console ,but when it comes to windows forms I have a problem in viewing my results to the user.
  here is the code I used (yes i included System.Diagnostics)</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using System.Diagnostics;
  
  namespace WindowsFormsApplication5
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
              //test
              PerformanceCounter CpuCount = new PerformanceCounter("Processor Information", "%Processor Time", "_Total");
             //textBox1.Text = CpuCount.NextValue().ToString();
              textBox1.Text = String.Format("{0} %", CpuCount.NextValue());
  
          }
      }
  }
  
  //textBox1.Text = CpuCount.NextValue().ToString();
  //textBox1.Text = String.Format("{0} %", CpuCount.NextValue());
  </code></pre>
  
  <p>these two lines I found while searching to get the output to show in <code>textBox1.Text</code><br>
  but it shows as blank when I run the program.</p>
  
  <p>Can anyone give me a hint please?</p>