开发者

Setting form size: designer shows different values than in code

I want to have a form with 200 x 200 pixels. However when I set it in the designer, in the code it reads 192x17开发者_StackOverflow中文版3. Why there is this difference?


In the designer, you enter the size of your form including the window borders (the caption bar at the top and the borders to the left, right and bottom of your screen).

The designer converts this to the client area size (without these borders). The reason for this is that the size you entered in the designer may not correspond to the clients computer. For example, the default Windows XP theme has a caption bar that is larger than the Windows 95/Windows 2000 theme.

Because it stores the client area size, you will be ensured that the size of the area available to you to put controls on will be the same regarding of the theme the client computer has set for Windows.

Why they chose the the size being entered in the designer to be the size including the window borders, I don't know.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜