Wednesday, April 18, 2012

Top-Left box alignment on a multi-line CheckBox with a large font

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).



Any ideas?



I'd like to note that:




  1. I already tried a few option, such as using a custom designer, a TableLayoutPanel, etc., but didn't get far.

  2. .Net 2.0 is forced - upgrading is not an option.



Thanks in advance.



CheckBox Issues





No comments:

Post a Comment