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 8557287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:32:28+00:00 2026-06-11T15:32:28+00:00

I have a MainWindow that will with the click of the button do some

  • 0

I have a MainWindow that will with the click of the button do some calculations that might take a few seconds.
During that time I would like to show a little dialog (or separate window) saying “Please wait…” in the middle of MainWindow that will fully block it, so the user is not able to do anything until this dialog is closed.
I tried creating a window and opening it with window.ShowDialog(); but that will of course not continue the instructions…

Is there any other way that will work?

  • 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-11T15:32:29+00:00Added an answer on June 11, 2026 at 3:32 pm

    The solution is very straightforward – you should set your MainForm as a parent in the Show (not ShowDialog, as you noticed), and then call Enabled = false on your own form:

            Form2 f = new Form2();
            f.Show(this);
            this.Enabled = false;
    
            //do your stuff here
    
            f.Hide();
            this.Enabled = true;
            f.Dispose();
            f = null;
    

    The only problem here is that you cannot cancel your process… But if your calculation is in another thread, the other form’s controls will trigger their handlers and you can cancel the work in the other thread.

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

Sidebar

Related Questions

I have MainWindow with a button, under the button click event I want MainWindow
I have a view that is loaded in the MainWindow.xib. It is just a
I would like to have a QMainWindow that can change it's look at runtime,
I have an MVVM setup with a mainwindow that contains a ContentControl. I set
I have a simple app that I am doing that will load a list
I have a user control that contains button as follows <UserControl x:Class=MyNamespace.myuseercontrol> <Button Name=uxRemove
I have one MainWindow.xib file. I have one label and one button on first
I have an application with a main window that loads in text file(s) and
I have a main window, that opens another window. I want to close this
I have module application. When I run it, the main window of that app

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.