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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:33:31+00:00 2026-06-05T12:33:31+00:00

I am developing an application in C# WPF .NET 3.5. I have a main

  • 0

I am developing an application in C# WPF .NET 3.5. I have a main window M, from which I open a modeless child window C1 with Owner property not set using Window.Show() method. From C1 window I create another child window C2. From C2 I create another child window C3. C2 and C3 are both modeless, created with Window.Show() method and with Owner property not set. Below is the sequence of windows:

M -> C1 -> C2 -> C3

I want the window behavior as follows. If C1 is clicked and if C2 is open, C2 is brought to top. If C2 is brought to top or if C2 is clicked and if C3 is open, C3 is brought to top. If M is clicked, then M should come to top. Thus C1, C2 and C3 would behave like modal windows. However I do not want C1, C2 and C3 to be actually modal i.e. I do not want to create them with Window.ShowDialog() method with Owner property set. This is because I want the user to be able to go to main window M if needed. How can I achieve this behavior?

I thank you in advance for your help.

geekowl

Update:

I added GotFocus event hander in the parent window as per suggestion, but GotFocus event does not get fired. So I added Activated event handler and in this handler called Activate() of the child window. This almost solved the problem, but under certain conditions this approach does not work perfectly. For example, when child is minimized and the parent is clicked, the child gets activated but the child does not get automatically maximized. I tried to bring the child to top using other methods instead of using Activate() but none of them gave a perfect solution. Ultimately, I used the method to hide the parent window after showing the child window and show the parent again when the child is closed.

  • 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-05T12:33:34+00:00Added an answer on June 5, 2026 at 12:33 pm

    You should be able to do this if you windows all have references to each other by using the Control.Focus() method.

    You’d add an event handler to C1 that would call C2.Focus() when it is clicked. You’d do the same with C2 calling C3.Focus().

    Based on what I’m gathering from your question, I think the best event for you to add a handler to would be the GotFocus event in your C1 and C2 windows. Basically, whenever they “gain focus”, you would check to see if their child window is open, and then call Focus() on the child window. This would trigger GotFocus on that window (so if your user clicks on C1, it would bring C2 to the top, and then bring C3 to the top).

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

Sidebar

Related Questions

I'm developing a C#/.NET application (Winforms/WPF, not entirely decided yet) which needs to display
I'm developing an application in WPF (.NET 4). I have an attached property that
I'm developing a WPF application which reads and writes XML data. I'm coming from
I'm developing an application in WPF and .Net 4 which contains animations. My controls
I am developing a WPF application (in .NET 4) which contains a lot of
I am developing a WPF application, and have a TextBlock which I want to
I'm developing a WPF application using MVVM. Inside a Window, I have a control
I have been developing an application for the last 12 months using VS2008, VB.NET(WPF)
I am developing a WPF application in .NET 4.0 which calls a WCF Service
I am developing an application in NET 3.5 C# and WPF and from the

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.