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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:20:10+00:00 2026-05-23T19:20:10+00:00

Is there a way to check that a WinForm is fully visible on the

  • 0

Is there a way to check that a WinForm is fully visible on the screen (eg is not out of bounds of the screen?)

I’ve tried using SystemInformation.VirtualScreen for this, which works great as long as the virtual screen is a rectangle, but as soon as it’s not (eg 3 screens in a L shape), SystemInformation.VirtualScreen returns the smallest rectangle containing all the visible pixels (so a window on the upper right corner of the L won’t be visible although it’s in the virtual screen)


The reason I’m trying to achieve this is that I’d like my program to open its child windows in the last location they were on, but I don’t want those window to be out of view if the user changes is setup (eg unplugs the extra screen from his laptop)

  • 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-05-23T19:20:11+00:00Added an answer on May 23, 2026 at 7:20 pm

    Here’s how I eventually did it :

    bool isPointVisibleOnAScreen(Point p)
    {
        foreach (Screen s in Screen.AllScreens)
        {
            if (p.X < s.Bounds.Right && p.X > s.Bounds.Left && p.Y > s.Bounds.Top && p.Y < s.Bounds.Bottom)
                return true;
        }
        return false;
    }
    
    bool isFormFullyVisible(Form f)
    {
        return isPointVisibleOnAScreen(new Point(f.Left, f.Top)) && isPointVisibleOnAScreen(new Point(f.Right, f.Top)) && isPointVisibleOnAScreen(new Point(f.Left, f.Bottom)) && isPointVisibleOnAScreen(new Point(f.Right, f.Bottom));
     }
    

    There might be some false positive if the user has a “hole” in his display setup (see example below) but I don’t think any of my users will ever be in such a situation 🙂

       [1]
    [2][X][3]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to check that my page is not opened in another
How do you check if there is an internet connection using jQuery? That way
Is there a way with NSJSONSerialization to check that the NSData is valid JSON?
Is there a way to check if the form that has been loaded with
Is there a way to implement a CHECK constraint that checks a value against
Is there an easy way to check in a unit test that two arrays
Is there a way to uncheck/check a checkbox within a webpage that is loaded
i need to know is there any way to check that the user has
Is there any way to check that a variable is a valid JSON string
Is there a way to check that value of an element in the XML

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.