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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:31:41+00:00 2026-06-09T04:31:41+00:00

In my application I want to close a particular window when I press a

  • 0

In my application I want to close a particular window when I press a button in another window manually by coding, if it is opened. How to check whether a window is opened?
Thanks in advance.

  • 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-09T04:31:43+00:00Added an answer on June 9, 2026 at 4:31 am

    You really should be keeping track of this kind of thing yourself inside of your application…

    But, since it sounds like you’re not, you can lean on WPF to do it for you. It keeps track of all the open windows in your application, exposed through the Application.Current.Window collection, so you can iterate through this collection looking for a match to windows of the type you’re interested in.

    For example:

    foreach (var wnd in Application.Current.Windows)
    {
        if (wnd is MyWindow)
        {
            // We found one!
            //
            // Close it or do something else interesting here.
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an application that I dont want it to close. So on
In my application I want to create a dialog which has a button to
Hi I have application with more than 20 activities.I want to close my app
im developing windows application using c#. i want to close the application and show
I want to close my application, so that it no longer runs in the
i want to close or stop running application when i exit from main screen
I want to close my application when it goes background. My current method is
I want to close running instance of my application on repair option of my
How can I close a window of external application programmatically in VB.net. I just
In my application i want to set flag for favorites quote.On button click i

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.