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

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
 
M

Morten Wennevik

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top