Para facilitar una pregunta anterior answer a su pregunta.
Aquí está el código fuente que necesitará para trabajar con la función GetUpdateRect como jdv-Jan de Vaan respondida.
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
internal struct RECT
{
public int Left;
public int Top;
public int Right;
public int Bottom;
public int Width { get { return this.Right - this.Left; } }
public int Height { get { return this.Bottom - this.Top; } }
}
[System.Runtime.InteropServices.DllImport("user32.dll")]
internal static extern bool GetUpdateRect(IntPtr hWnd, ref RECT rect, bool bErase);
public static bool IsControlVisibleToUser(Control control)
{
control.Invalidate();
Rectangle bounds = control.Bounds;
RECT rect = new RECT { Left = bounds.Left, Right = bounds.Right, Top = bounds.Top, Bottom = bounds.Bottom };
return GetUpdateRect(control.Handle, ref rect, false);
}
Cuando es necesario comprobar si un determinado es visible justo hacer algo como lo siguiente:
if (IsControlVisibleToUser(controlName) == true)
{
// The Specified Control is visible.
// ... do something
}
else
{
// Control is not visible.
// ... do something else
}
Buena suerte.
No creo que haya tal cosa incorporada, pero siempre se puede iterar sobre todos los controles de nivel superior y comprobar su superior, izquierda, anchura y altura. –