Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8632821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:24:14+00:00 2026-06-12T09:24:14+00:00

Possible Duplicate: C#, WPF – OpenFileDialog does not appear I’m trying to make the

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:24:15+00:00Added an answer on June 12, 2026 at 9:24 am

    Adding [STAThread] above Main fixes the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Inheriting from a UserControl in WPF I'm trying to create a WPF
Possible Duplicate: Getting the application's directory from a WPF application I want to acess
Possible Duplicate: What is the difference between WPF and Silverlight application? What are the
Possible Duplicate: 19 Threads for WPF Application I just created a simplest WPF application
Possible Duplicate: How to resize a Canvas in WPF? I need to make resizable
Possible Duplicate: MainWindow constructor getting called twice I am developing a WPF application following
Possible Duplicate: WPF: XAML property declarations not being set via Setters? I am stuck
Possible Duplicate: How can a WPF application be launched before I logon to Windows?
Possible Duplicate: Why use MVVM? I am trying to implement MVVM in my WPF
Possible Duplicate: How can one host Flash content in a WPF application and use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.