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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:51:21+00:00 2026-06-04T12:51:21+00:00

I have a main form ( form1 ). Within that form I successfully open

  • 0

I have a “main” form (form1).
Within that form I successfully open another form (form2) – but – when that form is open, you can still control the underlying form (form1).

I don’t want the user to be able to do so, and whenever he tries to click on it or something, the popped-up form (form2) should gain focus/flash a bit, with some default Windows sound.
I’ve just described how it acts if the popup window is a FileSave/OpenDialog. Those dialogs work exactly as I want them to work.

I’ve tried setting form2.Owner = form1; but that did not result in the desired effect.

So my question basically is: how can I get the same effect of focus/etc. on a form – just how it is on a Save/OpenDialog?

Thanks,

~ Tgys

  • 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-04T12:51:22+00:00Added an answer on June 4, 2026 at 12:51 pm

    To open the form2 use form2.ShowDialog()

    In form1 class

    form2 form2Object = new form2();
    form2.ShowDialog(this);
    

    This way form1 will remain in the background and un-clickable until form2 is shown. You can also return the dialog result from form2 if you want. Code from MSDN.

      Form2 testDialog = new Form2();
    
       // Show testDialog as a modal dialog and determine if DialogResult = OK.
       if (testDialog.ShowDialog(this) == DialogResult.OK)
       {
          // Read the contents of testDialog's TextBox.
          this.txtResult.Text = testDialog.TextBox1.Text;
       }
       else
       {
          this.txtResult.Text = "Cancelled";
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows form application that will open other forms, but will only
I have one main windows form and within that form I have custom controls
In my main form (form1) I have checkboxes that when checked should also check
i have a main form that contains an inner form (that inner form appears
I have a main form with a tab control, and each tab has a
I have a main form that most of my interactions occur on. I also
I have a main form, and a floating child form that is non-modal. The
I have a main form and non-modal autocomplete form. How can I prevent the
I have a main form with a tab control containing multiple subforms. I need
Within a form I have a button that launches a cfwindow, then presents a

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.