Placing text on left or right side of a C# CheckBox control.

  • Thread starter Thread starter Valerie Hough
  • Start date Start date
V

Valerie Hough

I am using the ContentAlignment property, and it seems to make no
difference.
Is this the right property, and if so, what else might I be doing wrong?
Thanks in advance.
Chris Hough
 
Hi Valerie (or Chris),

CheckAlign using ContentAlignment is the correct way to do it. However,
remember that it is the checkbox that is aligned, not the text, so to get
the text on the left side you have to use ContentAlignment.MiddleRight or
similar.

TextAlign using ContentAlignment will align the text but will not make it
switch sides.

CheckAlign = ContentAlignment.MiddleRight;
TextAlign = ContentAlignment.MiddleLeft;
SomeText [x]

CheckAlign = ContentAlignment.MiddleRight;
TextAlign = ContentAlignment.MiddleRight;
SomeText[x]

CheckAlign = ContentAlignment.MiddleLeft;
TextAlign = ContentAlignment.MiddleLeft;
[x]SomeText

CheckAlign = ContentAlignment.MiddleLeft;
TextAlign = ContentAlignment.MiddleRight;
[x] SomeText

Happy coding!
Morten
 
Back
Top