title: C#: What am I doing wrong with the textbox?
body: <p><a href="https://i.stack.imgur.com/K1Bxe.jpg" rel="nofollow noreferrer">This is what the app looks like so far. </a>The program is suppose to allow the user to enter a distance, then it'll have a "from" box and a "to" box that will convert the distance to something like "from inches to feet" for example.</p>
  
  <p>When i run the program though the to and from boxes are empty. In the boxes there should be inches, feet, and yards listed. What is wrong in my code here?</p>
  
  <pre><code>namespace DistanceConverter
  {
      public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
  
      private void convertButton_Click(object sender, EventArgs e)
      {
  
          int fromDistance;
          int toDistance = 0;
  
          fromDistance = int.Parse(textBox1.Text);
          string measureInput = fromBox.Items[fromBox.SelectedIndex].ToString();
          string measureOutput = toBox.Items[toBox.SelectedIndex].ToString();
  
          switch (measureInput)
          {
              case "Yards":
                  switch (measureOutput)
                  {
                      case "Inches":
                          toDistance = fromDistance;
                          break;
                      case "Yards":
                          toDistance = fromDistance * 3;
                          break;
                      case "Feet":
                          toDistance = fromDistance * 3 * 12;
                          break;
                  }
                  break;
              case "Feet":
                  switch (measureOutput)
                  {
                      case "Inches":
                          toDistance = fromDistance;
                          break;
                      case "Yards":
                          toDistance = fromDistance / 3;
                          break;
                      case "Feet":
                          toDistance = fromDistance * 12;
                          break;
                  }
                  break;
              case "Inches":
                  switch (measureOutput)
                  {
                      case "Inches":
                          toDistance = fromDistance;
                          break;
                      case "Feet":
                          toDistance = fromDistance / 12;
                          break;
                      case "Yards":
                          toDistance = fromDistance / (3 * 12);
                          break;
                  }
                  break;
          }
  
          distanceConverted.Text = toDistance.ToString();
      }
  }
  </code></pre>
  
  <p>}</p>