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

  • SEARCH
  • Home
  • 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 6826025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:05:57+00:00 2026-05-26T22:05:57+00:00

I have two open winforms, say that winform1 gets a modal dialog, this means

  • 0

I have two open winforms, say that winform1 gets a modal dialog, this means that all forms(winform1 and winform2) will be “disabled”. If we minimize all forms and then bring up winform1, then the modal dialog will be shown above it. If we again minimize all the forms but this time brings up winform2, it will look like the finform2 is ready to be used while its really disabled like winform1.

What I need is to clearly show that the modal dialog needs to be handled before using winform2 again.

Is there anything built in to handle this or am I on my own here?

  • 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-05-26T22:05:58+00:00Added an answer on May 26, 2026 at 10:05 pm

    In your winform2.Activated event handler, call this:

        static void FocusModalForm()
        {
            foreach (Form form in Application.OpenForms)
                if (form.Modal)
                {
                    form.WindowState = FormWindowState.Normal;
                    form.BringToFront();
                }
        }
    

    e.g.

       Form f2 = new Form();
       f2.Activated += (_, __) => FocusModalForm();
       f2.Show();
    

    You may need to do the same thing for winform1‘s Activated event. It depends how winform2 gets created. Just try it and if you find that winform1 (or any other nonmodal form) is still able to get in front of the modal form, just call FocusModalForm() from its Activated event.

    I tried this in Windows 7. I tried hiding all windows (click the Show Desktop button on the taskbar) and then selecting form2 directly from the taskbar, and I also tried just selecting form2 from the taskbar without hiding all windows. Form3 always stayed on top.

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

Sidebar

Related Questions

Let us say that I have two Xcode projects open on a Mac and
I have two pages. From the first page, I open a modal with a
I have a C# .net winforms application with two forms which connects to sql
I have two appWidgets, now if user open Add widget dialog, both widgets will
I have used two GUIDs to open the folders My Computer and My Documents
I almost always have a Scala REPL session or two open, which makes it
I have an odd need to open two separate instances of excel and having
I have several projects open in an Eclipse workspace. Like so: com.harbl.project.one com.harbl.project.two com.harbl.project.three
I have two applications written in Java that communicate with each other using XML
I want to prevent activation of all other forms in my winforms application when

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.