title: c# clear textbox
body: <p>I have this code:</p>
  
  <pre><code>private void button2_Click(object sender, EventArgs e)
      {
          //add pgs selected to array, array needs to be global? combobox1 accCollection.Items.Add(value);
          textbox18.text = "";
          pgHolder[pgCount] = comboBox1.Text + ", "; // error here why?
          pgCount++;
  
          foreach(string Pg in pgHolder)
          {
              pgTemp = Pg;
              pgHolder1 += pgTemp;
          }
  
          textBox18.Text = pgHolder1;
      }
  </code></pre>
  
  <p>I've attempted a <code>txtbox.text = "";</code> but this doesn't work. Am I missing something here? Is there a <code>.clear</code> or do I need to do something fancy?</p>
  
  <p>As you can tell I'm trying to clear the text box each time I click the button.</p>
  
  <p>!!UPDATE!!
  my string array is declared with default values of "0,0,0,0"
  ok it looks like it wasnt the textbox but my logic, heres what happens</p>
  
  <p>Clicked,  combo box = "50",  displays "50,0,0,0"
  Clicked,  combo box = 75 ,   displays "50,0,0,0,50,75,0,0"</p>
  
  <p>i need it to display 50,75,0,0.</p>