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 (
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).
I'd like to note that:<ol> <li>I already tried a few option, such as using a custom designer, a TableLayoutPanel, etc., but didn't get far.</li> <li>.Net 2.0 is forced - upgrading is not an option.</li> </ol>
Thanks in advance.
<img src="https://i.stack.imgur.com/uSG2c.png" alt="CheckBox Issues">
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.
<img src="https://i.stack.imgur.com/8f26d.png" alt="enter image description here">