Serialcoder en Français Serialcoder in English
TEL : +33 (0)9 72 13 15 17

Windows Forms FAQ resources

2. Windows Forms Controls

2.7 Why should I provide a Non-Client border to my Control derived class?


Providing a border in the non-client region of your control rather than in the ClientRectangle has very many advantages:

  • When you include a scrollbar in your control, the scrollboar will appear inside the border, rather than to the outside if you drew the border in the client area.
  • When you allow custom painting of the control, your user will not draw over the NC border.
  • Your own client painting code will be simplified in that you will not have to bother about taking the border into account while painting the client area.
  • The next faq will tell you how to include a non-client border.