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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:06:20+00:00 2026-06-04T19:06:20+00:00

If I create a class derived from System.Windows.Window and show it with ShowDialog it

  • 0

If I create a class derived from System.Windows.Window and show it with ShowDialog it appears above the main window as expected, and the main window is disabled.
However it is possible to put both windows behind other applications, and then just bring the main window back. This just leaves a single window which appears to have crashed, and can be confusing.

Is it possible to ensure that the dialog window is always displayed if the main window is shown? The MessageBox.Show dialog has no such problems

Update:

A test dialog is defined as

public partial class MyDialog : Window
{
    public MyDialog()
    {
        InitializeComponent();
    }
}

and called using

    MyDialog d = new MyDialog();
    d.ShowDialog();
  • 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-04T19:06:21+00:00Added an answer on June 4, 2026 at 7:06 pm

    you have to set the Owner property.

    MyDialog d = new MyDialog();
    d.Owner = Application.Current.MainWindow;//or your owning window
    d.ShowDialog();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to create a derived control from System.Windows.Forms.ComboBox that is bound to a
I'm currently designing a custom tab control class which derives from System.Windows.Forms.Control. The problem
I found the problem with PopulateOnDemand with my treview class derived from System.Web.UI TreeView.
I have a control (derived from System.Windows.Forms.Control) which needs to be transparent in some
I have my own custom control derived from System.Windows.Forms.TreeView which is present on the
i created a class derived from CheckedListBox so i can change item height as
I created a ControlTemplate for my custom control MyControl . MyControl derives from System.Windows.Controls.Control
I have create the class HoverButton which derives from Form.Button. Here I override the
I have created a BasePage class that inherits from System.Web.Ui.Page. In that base class
I've written a custom authorization attribute derived from System.Web.Mvc.AuthorizeAttribute . I'm using it successfully

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.