问题描述
工作在一个WinForms NET 2.0的项目,我需要一个复选框,支持多行,这样箱子本身将被放置在顶部的左上角。
这将做的是 CheckAlign = System.Drawing.ContentAlignment.TopLeft
,它不同于缺省( MiddleLeft
)。
Working on a WinForms .Net 2.0 project, I need a checkbox to support multiple lines such that the box itself will be aligned to the top-left corner.
This is done using CheckAlign = System.Drawing.ContentAlignment.TopLeft
, which different from the default (MiddleLeft
).
当用默认字体这看起来行工作,但是当字体变大 - 什么情况是,上面的文本的增加的间隙,但上面的框本身的间隙保持恒定。维基,结果是框出现在上面的文字(见下图)。
When working with the default font this looks OK, but when the font becomes larger - what happens is that the gap above the text increases, yet the gap above the box itself remains constant.
The result is that the box appears above the text (see illustration below).
任何想法?
我想需要注意的是:
- 我已经尝试了一些选项,比如使用自定义设计,一个TableLayoutPanel等,但并没有走远。
- 在NET 2.0强制 - 升级是不是一种选择
在此先感谢。
推荐答案
该复选框实际上是对齐文本。但在某种程度上,只能请一个印刷工人。这只是一个大的字体有更多的上升段高度,空间,变音符号去。尝试这里的问题。这是不是你可以随便修改。的CheckedListBox也不支持所有者描述,它是在普通pretty的有缺陷的控制。如果你不希望使用的OwnerDraw列表框,然后MiddleLeft或更小的字体是唯一体面的选择。
The checkbox is actually aligned to the text. But in a way that could only please a typographer. It is just that a large font has more ascender height, the space where the diacritics go. Try "Ĥere's the problem". That's not something you can tinker. CheckedListBox also doesn't support owner draw, it is in general a pretty flawed control. If you don't want to use an ownerdraw ListBox then MiddleLeft or smaller fonts are the only decent options.
这篇关于在一个多行复选框左上框对准大字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!