none
Checkbox check alignment RRS feed

  • Question

  • I don't see any easy way to change how the check lines up in a checkbox. I'd like to be able to have the text centered at the top and the checkbox centered underneath. Anyone know a way to implement this?
    Thursday, December 3, 2009 5:21 PM

Answers

  • Hi Wil,

    have a look at this CodeProject article where Karl Shifflet shows how to place the text-portion of a checkbox on the left rather than on the right. I haven't tried it myself, but I guess the technique would be the same when you want the text on top ...
    Cheers,
    Olaf
    • Marked as answer by Wil Burton Friday, December 4, 2009 2:13 AM
    Thursday, December 3, 2009 10:18 PM

All replies

  • Wil,
    In these cases I just use a StackPanel and add an empty CheckBox and a TextBlock.
    I think you can also use something like this:
    <CheckBox><TextBlock text="Whatever"/></CheckBox> and then set the Margin on TextBlock so that it is positioned to where ever you want.

    Hope this helps
    noorbakhsh
    Thursday, December 3, 2009 6:54 PM
  • Hi Wil,

    have a look at this CodeProject article where Karl Shifflet shows how to place the text-portion of a checkbox on the left rather than on the right. I haven't tried it myself, but I guess the technique would be the same when you want the text on top ...
    Cheers,
    Olaf
    • Marked as answer by Wil Burton Friday, December 4, 2009 2:13 AM
    Thursday, December 3, 2009 10:18 PM