title: How can I neatly line up right-aligned check boxes with with other controls?
body: <p>The Visual Studio WinForms designer lets you snap together text boxes, list boxes, buttons, and so forth reasonably well.  However, a check box with CheckAlign=MiddleRight does not work quite like the others, because it has two components: the built-in label, and the check box itself.  If you line up the text with other labels, the check box is left floating and will not automatically line up.  You can turn off AutoSize and attempt to size the <code>CheckBox</code> control so the check box lines up, but this is touchy and will be thrown off by custom font sizes.</p>
  
  <p>In this example, I've <em>almost</em> lined up the check box with the other controls, but not quite:</p>
  
  <p><img src="https://i.stack.imgur.com/i8ERF.png" alt="Example of controls not lining up"></p>
  
  <p>If I had several check boxes it would be a real headache, as with AutoSize turned off the position of the check box is relative to the end of the text, so each control has to be individually sized pixel by pixel.</p>
  
  <p>What's the best way to line up check boxes with other controls?</p>
  
  <p>One workaround is to not include text with the <code>CheckBox</code> and instead have a separate <code>Label</code> control.  However, by doing so you lose the ability to click on the label to toggle the check box.  On a high-resolution screen, clicking a 10x10 pixel is finicky, a poor UX experience.  You could add an <code>OnClick</code> event to the label, of course, but that seems like solving the wrong problem.</p>
  
  <p>Here's an example of someone else with the same issue: in the preferences panel in Oracle SQL Developer, when there's a mix of properties the check boxes are handled with separate labels and boxes:</p>
  
  <p><a href="https://i.stack.imgur.com/gpuPy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gpuPy.png" alt="Labels are left-aligned, text boxes and check boxes are right-aligned"></a></p>