I'd like to use Segoe UI 9 pt on Vista, and Tahoma 8 pt on Windows XP/etc. (Actually, I'd settle for Segoe UI on both, but my users probably don't have it installed.) But, these being quite different, they really screw up the layout of my forms. So... is there a good way to deal with this?
An example: I have a Label
, with some blank space in the middle, into which I place a NumericUpDown
control. If I use Segoe UI, the NumericUpDown
is about 5 pixels or so to the left of the blank space, compared to when I use Tahoma. This is a pain; I'm not sure what to do here.
So most specifically, my question would be: how can I place controls in the middle of a blank space in my Label
s (or CheckBox
es, etc.)? Most generally: is there a good way to handle varying fonts in Windows Forms?
Edit: I don't think people understood the question. I know how to vary my fonts based on OS. I just don't know how to deal with the layout problems that arise from doing so.
*Reply to ajryan, quick_dry*: OK, you guys understand the question. I guess MeasureString might work, although I'd be interested in further exploration of better ways to solve this problem.
The problem with splitting the control is most apparent with, say, a CheckBox
. There, if the user clicks on the "second half" of the CheckBox (which would be a separate Label
control, I guess), the CheckBox
doesn't change state.