Try this code:
Dim g as Graphics
g = frmMain.CreateGraphics()
g.DrawLine(Pens.Black, new Point(0,0), _
new Point(frmMain.ClientRectangle.Width), frmMain.ClientRectangle.Height)
g.Dispose()
This should draw a line from the upper left to the bottom right corner of your application, but only if it's visible. If this code isn't in the paint event, when something obscures your application or it repaints, this line will not be redrawn.
Shawn Burke, Microsoft