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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:23:42+00:00 2026-06-15T17:23:42+00:00

How do I detect if window is not visible to the user and then

  • 0

How do I detect if window is not visible to the user and then move it to a position that is visible to allow the user to size it to their liking.

The problem:-
I have a program that save the position and size of the form this works perfectly.
Unfortunately, many users now have multiple screen graphics cards that can be switched between duplicate and extended.

Therefore, if the user closes the form (the program saves where it was) and the user switches his system to say extended from duplicate then opens the program.
The program form is now not visible because it has moved off the limits of the current screen system 🙁
The user can see it running on the task bar. However clicking the icon only gives a brief flash of minimising or maximising the program and right clicking only has the option to close.

I need to trap for not visible to the user and then auto resize to any active window. The user can then resize/move as they see fit.

I would welcome any ideas/pointers

  • 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-15T17:23:44+00:00Added an answer on June 15, 2026 at 5:23 pm

    This answer was provided for the same question on the MSDN forums – essentially, it’s a quick check of the bounds of the screen, and checks to see if the program is within those bounds. If not, it moves it to 0, 0:

    using System.Windows.Forms; 
    
    class Form1 : Form {
        protected void EnsureVisible() {
            foreach (Screen scrn in Screen.AllScreens) {
            // You may prefer Intersects(), rather than Contains()
                if (scrn.Bounds.Contains(this.Bounds)) {
                  return;
                }
            }
            this.Location = new Point( 0, 0 );
        }
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use CBT Windows Hook to detect window creation/deletion/min-max/move-size events. I works well, but
How do I detect that an Emacs window has already been split? In my
I have a situation where I have to detect when an application window is
Is there a jquery way or plugin to detect the visitor's browser window size
Anyone have a nifty trick (in Python) to detect Windows services that are configured
I have a form that is displayed, not by ShowDialog, but by setting its
Possible Duplicate: Is there a way to detect if a browser window is not
I noticed that in Windows, if you maximize a window you can not resize
In Delphi XE, I'm trying to use GetForegroundWindow to detect the window that was
I want to sub-class the actual window to detect when its size has changed.

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.