Live Chat Icon For mobile
Live Chat Icon

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

Platform: WinForms| Category: Controls

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 scrollbar 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.

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.