Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

Why should I provide a border in the non-client region for a custom control?

Providing a border in the non-client region of a control, rather than in the ClientRectangle, has several advantages.

If you include a scrollbar in the control, the scrollbar will appear inside the border. If you draw the border in the client area, the scrollbar will appear outside the border.

If the control allows custom painting, the user will not draw over the non-client border.

The control's client painting code will be simplified because you will not have to taking the border into account while painting the client area.

Contributed from George Shepherd's Windows Forms FAQ



Page view counter