Question: I am using a RichTextBox in WPF, and am trying to set the default paragraph spacing to 0 (so that there is no paragraph spacing). While I could do this in XAML, I would like to achieve it programmatically if possible. Any ideas?

Answer: 
In C# 2008 WAP

```
richtextbox1.SelectionCharOffset =
    -1 * ( Convert.ToInt32(R223.Txt_Space_Before.Text) * 100);

```

or

```
richtextbox1.SelectionCharOffset =
    Convert.ToInt32(R223.Txt_Space_Before.Text) * 100;

```

can be used for Line Spacing.

This is the only way you can have line height spacing.
I know this question was posted before I even started coding but I found that simply setting `ShowSelectedMargin` to `true` did the trick