Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
Default to single line spacing.
posted

I would like to be able to set the default action to single line spacing.  I have found some code as follows that allows you to change the line spacing of a selection.  This code wont work in my case because when the text editor is loaded there is no initial selection.

ParagraphSettings paragraphSettings = new ParagraphSettings();

ParagraphSpacingSettings paragraphSpacingSettings = new ParagraphSpacingSettings();

paragraphSettings.WordWrap = true;

paragraphSettings.Spacing = paragraphSpacingSettings;

paragraphSpacingSettings.LineSpacing = new LineSpacing(1);

string error;

_textEditor.Document.ApplyParagraphSettings(_textEditor.Selection.DocumentSpan, paragraphSettings, out error);

Parents Reply Children