Possible Duplicate:
C#, WPF - OpenFileDialog does not appear
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.
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.
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;
}
}
Thanks!