title: Dragging files into rich textbox to read text in file
body: <p>I'm having a problem with dragging and dropping files onto a richTextBox, every time I drag a text file onto it, it turns into a picture of the text file with its name under it. Double click the file and it opens up using the system default application (ie notepad for text files, etc). basically its making shortcuts in the richTextBox, when i want it to read the text in the file. </p>
  
  <p>Based on this code, the text from the file <strong>should</strong> extract into richTextBox1  </p>
  
  <pre><code>    class DragDropRichTextBox : RichTextBox
      {
      public DragDropRichTextBox()
      {
          this.AllowDrop = true;
          this.DragDrop += new DragEventHandler(DragDropRichTextBox_DragDrop);
      }
  
      private void DragDropRichTextBox_DragDrop(object sender, DragEventArgs e)
      {
          string[] fileNames = e.Data.GetData(DataFormats.FileDrop) as string[];
  
          if (fileNames != null)
          {
              foreach (string name in fileNames)
              {
                  try
                  {
                      this.AppendText(File.ReadAllText(name) + "\n");
                  }
                  catch (Exception ex)
                  {
                      MessageBox.Show(ex.Message);
                  }
              }
          }
      }
  </code></pre>
  
  <p>Any ideas on how to make this work?</p>