• Advertisement
Sign in to follow this  

[.net] Detecting visibility of a form

This topic is 4646 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I detect whether or not the contents of a form are actually visible on the screen? I am not just talking about the Visible property. I would like to be able to tell if a form is covered by another window or dragged so that the contents are not visible onscreen.

Share this post


Link to post
Share on other sites
Advertisement
That won't work. It could not have focus and still be visible.

Share this post


Link to post
Share on other sites
Quote:
Original post by Stru
How can I detect whether or not the contents of a form are actually visible on the screen? I am not just talking about the Visible property. I would like to be able to tell if a form is covered by another window or dragged so that the contents are not visible onscreen.

Are you asking if any portion of it is covered, or all of it is covered?

Share this post


Link to post
Share on other sites
I only need to know whether or not the entire client area of the form is covered. I dont care whether or not the control box / title bar is visible, just whats in the form. I also don't care if only part of the form is visible, even if its only one pixel, but if no pixels in the client part of the form are visible then I would like to know.

Share this post


Link to post
Share on other sites
The win32 function, GetWindow, should be one way to do it. You could determine which windows are in front of your window, and then do simple rect calculations to see if the entirety of your client area is blocked by any of the windows higher in the z-order.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement