Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I increase the space between the checkbox and the associated text?

I'm using WPF, and I have a CheckBox element with associated text/content. I've changed the FlowDirection to be RightToLeft so that the checkbox appears to the right of the text. But it appears very close to the text. I'd like to increase the spacing between the text and the checkbox, but of course the Margin option changes the outside margins of the whole control. Thanks for any ideas.

<CheckBox IsChecked="True" HorizontalAlignment="Left" FlowDirection="RightToLeft">Activate</CheckBox>
like image 707
Jarvis Avatar asked Jan 24 '12 16:01

Jarvis


People also ask

How do you put a space between checkbox and label?

Use margin-right .

How do you put a space between a checkbox and text in HTML?

If the intent of the user is to bring some more space between check box "box" and its corresponding text, you can use "&npsp;" in the Text content of the checkbox. Hope that helps.

How to give space between checkbox and text in asp net?

The checkbox is labeled by the 'Text' property. In my tests, text alignment property is not set so it defaults to 'right'. When rendered in compatibility mode, there is something like 2-4 pixels of blank space between the checkbox itself and its text label.


1 Answers

This should work too:

<CheckBox>
    <TextBlock Margin="10 0 0 0">Activate</TextBlock>
</CheckBox>
like image 97
Oliver Hanappi Avatar answered Oct 13 '22 07:10

Oliver Hanappi