RSK
RSK

Reputation: 2211

Windows Form size in the designer code does not match the size in the properties window

The form size displayed in the designer for the form doesn't match the size displayed in the properties window for the same form and I can't seem to get them to match. Please see below screenshots: enter image description here

enter image description here

Any idea why this is so?

Upvotes: 1

Views: 1360

Answers (2)

Sriram Sakthivel
Sriram Sakthivel

Reputation: 73442

What you see in Property window is Size and what you see in designer.cs is ClientSize. Size includes non client area also whereas ClientSize doesn't include them.

Upvotes: 2

Ove
Ove

Reputation: 6317

The client size of a form does not include the title bar and the borders.

The Size property of the form includes the title bar and borders.

From MSDN:

The size of the client area of the form is the size of the form excluding the borders and the title bar. The client area of a form is the area within a form where controls can be placed.

Upvotes: 3

Related Questions