title: C# OpenFileDialog opening twice
body: <p>I am having a problem with a windows form coded in Visual Studio using C# as part of a web development course. When I click on the menu item ('Import') the file dialogue box opens twice.</p>
  
  <p>The first dialogue seems incorrect as it does not have the filter or title applied. Then the second dialogue box which immediately opens afterward has the correct filter and title applied.</p>
  
  <p>Obviously it is only meant to open once to enable me to read the selected file and add it to the Listbox. This works, but only once I have selected the file twice.</p>
  
  <p>Thanks in advance for your help.</p>
  
  <pre><code>private void importToolStripMenuItem_Click(object sender, EventArgs e)
      {
          openFileDialog1.ShowDialog();
  
          openFileDialog1.Filter = "Text|*.txt";
          openFileDialog1.Title = "Choose a file to import";
  
          if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
          {
              MessageBox.Show("Oh. No file selected!");
          }
  
          else
          {
              string usersFile = openFileDialog1.FileName;
  
              string[] lines = File.ReadAllLines(usersFile);
  
              foreach (string line in lines)
              {
                  groceryList.Items.Add(line);
              }
          }
  </code></pre>