Visual Studio对齐组框 [英] visual studio align group box

查看:84
本文介绍了Visual Studio对齐组框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用Visual Studio2008.

我的UI中有几个按分组框分组的按钮

现在似乎无法垂直对齐这些分组框.

如果我向左或向右移动,它总是以2像素跳动(网格捕捉关闭)
即使我在资源中手动进行操作,将位置定义更改为1像素,结果也将更改为2像素...

我还尝试了一条对齐线,例如在146,组框的边框在捕捉线上
当我将对齐线放置在147(这是我希望的位置)时,组框的边框在148.当对齐线在148时,边框也在148.


我该如何更改?
真烦人!我希望我的UI看起来美观且对齐,没有意大利面条布局

谢谢

附言:问题似乎与我在对话框中选择的字体大小有关,

Hello Guys,

I am using visual studio 2008.

I have several buttons in my UI grouped with group-boxes

now it seems impossible to vertically align these group-boxes.

if I shift it to left or right, it always jumps with 2 pixels (grid snap is off)
even when I do manually in the resources, changing the position definition with 1 pixel, the result is a shift with 2 pixels...

I also tried a snap line, f.e. at 146 the border of the group box is on the snap line
when I place the snap line at 147 (this is the position I whish), the border of the group box is at 148. when the snap line is at 148 the border is also at 148.


how can I change this?
It is really annoying! I want my UI to look nice and aligned, no spaghetti layout

Thanks

PS It seems the problem is related to the font size I select in my dialog,
when I take an other font, all my group boxes get messed up!?

推荐答案

使用对话框单位而不是像素来布置对话框.
对话框单位基于字体.

这是有关计算对话框单位的知识库.
http://support.microsoft.com/kb/145994/EN-US [ ^ ]
A dialog is layed out using dialog units, not pixels.
Dialog units are based on the font.

Here is a KB about calculating dialog units.
http://support.microsoft.com/kb/145994/EN-US[^]


这篇关于Visual Studio对齐组框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆