title: How to annotate a changed item in a listbox with a *
body: <p>I just need help on how to annotate a changed item in the list box if the user changes something using the text boxes provided.</p>
  
  <pre><code>namespace HW1
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
  
          private void button1_Click(object sender, EventArgs e)
          {
  
              string[] values = new string[5];
              values[0] = textBox1.Text;
              values[1] = textBox2.Text;
              values[2] = textBox3.Text;
              values[3] = textBox4.Text;
              values[4] = textBox5.Text;
  
              string[] temp = new string[5];
              temp[0] = textBox1.Text;
              temp[1] = textBox2.Text;
              temp[2] = textBox3.Text;
              temp[3] = textBox4.Text;
              temp[4] = textBox5.Text;
  
              if(temp != values)
              {
                  listBox1.SelectedIndex = 0 + "*";
                  listBox1.Text = values[1] + "*";
                  listBox1.Text = values[2] + "*";
                  listBox1.Text = values[3] + "*";
                  listBox1.Text = values[4] + "*";
              }
  
  
              listBox1.Items.Clear();
  
              for (int i = 0; i &lt; values.Length; i++)
              {
                  listBox1.Items.Add(values[i].ToString());
              }
  
          }
  
  
          private void button2_Click(object sender, EventArgs e)
          {
              Application.Exit();
          }
      }
  }
  </code></pre>
  
  <p>The program will simply replace the old input from the text box with the new without displaying a * next to the item that has changed.</p>