Note that there are some explanatory texts on larger screens.

plurals
  1. POFont-dependent control positioning
    primarykey
    data
    text
    <p>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?</p> <p>An example: I have a <code>Label</code>, with some blank space in the middle, into which I place a <code>NumericUpDown</code> control. If I use Segoe UI, the <code>NumericUpDown</code> 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.</p> <p>So most specifically, my question would be: how can I place controls in the middle of a blank space in my <code>Label</code>s (or <code>CheckBox</code>es, etc.)? Most generally: is there a good way to handle varying fonts in Windows Forms?</p> <p><strong><em>Edit</em></strong>: I don't think people understood the question. I know how to <em>vary my fonts</em> based on OS. I just don't know how to <em>deal with the layout problems</em> that arise from doing so.</p> <p><strong><em>Reply to ajryan, quick_dry</em></strong>: 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.</p> <p>The problem with splitting the control is most apparent with, say, a <code>CheckBox</code>. There, if the user clicks on the "second half" of the CheckBox (which would be a separate <code>Label</code> control, I guess), the <code>CheckBox</code> doesn't change state.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload