Tutorial :Methods to find the visible area of a Windows.Forms component immediately?


I hate it when I try to apply some logic to positioning elements on a form, only to have the rug jerked out from under me because of some bizarre gotcha like the visible area of the Control being affected by a Border which, in effect, creates a 3 pixel margin all around the inner, visible area of the Panel, and completely throws off any size calculations I might want to make, and also offsets the 0,0 point of the control.

Even worse is the Form control itself, which in most cases has a gigantic top-edge margin where the title bar lives, but does not (as I recall) offset the 0,0 point, meaning that controls you place at that point often can't even be seen. And of course, the margin is different when different Windows themes have been applied...

Can you knowledgeable people run me through some of the more "interesting" lies Windows.Forms tells you about form areas and locations and how you've coped with it?


look at Form.ClientRectangle and Form.ClientSize

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »