Monday, November 21, 2005

How to Retrieve the Viewable Area of a Window or Control

I was trying to figure out how to find out whether a control is currently viewable or not (in C#). When I say ‘viewable’, I don’t mean ‘Visible’, which is a known property of the control. I wanted to know whether the control is currently hidden by some other application/form or whether part of it or all of it can be seen. I remembered vaguely that there was some way to do that with the Win32 API, but didn’t remember exactly how. Googling a bit I found out that Conrad Jones wrote a nice piece of code that does just that: http://www.codeguru.com/Csharp/Csharp/cs_misc/article.php/c4237/

 

Thanks man!

No comments: