title: C# Arrow Key is not captured
body: <p>I'm creating a program, that is able to draw on the full desktop. I have different functions for drawing for example an ellipse. There is also a function for inserting some Text. For this I use a transparent <code>TextBox</code>(Tbx). When I call this function, it creates a <code>Label</code>, that gets the Text of the <code>Textbox</code>, everytime I change the text. This works quite well, but I also have a function that should minimize the <code>Window</code> with <kbd>↓</kbd>. After inserting text, the key is useless, but the other keys are still captured with the event handler. If I don't insert text into <code>Textbox</code> control, I can minimize. The main problem is, that the <kbd>↓</kbd> is not captured with the event handler and the minimization doesn't happen. I'm unsure if <code>KeyDownEvent</code> is the correct event to capture special keys such as arrows, <kbd>Ctrl</kbd>, ... So the question is how to fix this code to capture <kbd>↓</kbd> and execute the code to minimize the <code>Window</code>.</p>
  
  <p>Here are some parts of my code:</p>
  
  <p>Creating a Label:</p>
  
  <pre><code>Tbx.Clear();
  if (!hasStartPoint)
  {
      START = current;
      hasStartPoint = true;
  }
  this.canvas1.Children.Remove(Lab2);
  Lab1 = new Label() { IsEnabled = true, Background = Brushes.Transparent, Foreground = this.brush, FontFamily = textFont, Content = "" };
  if (this.thickness &gt; 5000) { FontSize = 5000; }
  else { FontSize = this.thickness; }
  Canvas.SetLeft(Lab1, START.X);
  Canvas.SetTop(Lab1, START.Y);
  Tbx.Focus();
  isWriting = true;
  this.Cursor = Cursors.IBeam;
  canvas1.Children.Add(Lab1);
  Lab2 = Lab1;
  </code></pre>
  
  <p>Writing text:</p>
  
  <pre><code>void Tbx_TextChanged(object sender, TextChangedEventArgs e)
  {
      if (isWriting)
      {
          Lab1.Content = Tbx.Text;
      }
  }
  </code></pre>
  
  <p>Finished writing:</p>
  
  <pre><code>else if (e.Key == Key.Enter || e.Key == Key.End)
  {
      if (!isWriting)
      { this.Close(); }
      else
      {
          Lab1 = new Label() { IsEnabled = true, Background = Brushes.Transparent, Foreground = this.brush, FontSize = this.thickness, FontFamily = textFont, Content = "" };
          Canvas.SetLeft(Lab1, 1);
          Canvas.SetTop(Lab1, 1);
          canvas1.Children.Add(Lab1);
          isWriting = false;
          this.Cursor = Cursors.Cross;
      }
   }
  </code></pre>
  
  <p>Minimizing the Window in a <code>KeyDownEvent</code>:</p>
  
  <pre><code>else if (e.Key == Key.Down)
      this.WindowState = WindowState.Minimized;
  </code></pre>