title: C# - SerialPort.ReadLine() freezes my program
body: <p>I'm trying to read messages sent form my Arduino over a Serial port using baud rate 9600.</p>
  
  <p>My Arduino code is programmed to send a "1" whenever I press a button and a "0" when I release my finger off the button.</p>
  
  <p>So it's not constantly sending data.</p>
  
  <p>My C# Program is to read that message and add it to a ListBox. But whenever I start it, the program hangs.</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      SerialPort port = new SerialPort();
      port.BaudRate = 9600;
      port.PortName = "COM4";
      port.ReadTimeout = 1000;
      port.Open();
  
  
      timer1.Start();
  }
  
  private void timer1_Tick(object sender, EventArgs e)
  {
      try
      {
          ee = port.ReadLine();
          listBox1.Items.Add(ee);
      }
      catch (Exception)
      {
          timer1.Stop();
      }
  }
  </code></pre>
  
  <p>I guess, maybe the reason is that my program should check if there's data available to be received before receiving?</p>