OpenFileDialog.ShowDialog() freezing application c#
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2201227/c-wpf-openfiledialog-does-not-appear">C#, WPF - OpenFileDialog does not appear</a>  </p>
</blockquote>



<p>I'm trying to make the "JDEdit" application from John Hunt's Guide to C# and Object Orientation.  However, I put in all the code like he did and my application is freezing up whenever I try to use ShowDialog().  I'm not getting any compiler complaints so I'm not sure what's going on.</p>

<p>This is the method I'm trying to implement.  It freezes when checking the conditional.  I don't think the rest of the program should be necessary to post.</p>

<pre><code>private void Open() {

    // still working

    if (ofd.ShowDialog() == DialogResult.OK) {

        // never makes it here

        string filename = ofd.FileName;
        Console.WriteLine("Open: {0}", filename);
        textArea.TextChanged -= new EventHandler
            (this.TextArea_TextChanged);
        textArea.LoadFile(filename);
        textArea.TextChanged += new EventHandler
            (this.TextArea_TextChanged);
        saveRequired = false;
        this.Text = title + ": " + filename;
    }
}
</code></pre>

<p>Thanks!</p>
