Hi well my problem is this I have a RichTextBox but i wanna add a "pretty" space after the paragraph, i found on the internet many examples but all examples change all the lines and not only the paragraph.
private void FormatRTB(byte rule, int space, int x)
{
PARAFORMAT fmt = new PARAFORMAT();
fmt.cbSize = Marshal.SizeOf(fmt);
fmt.dwMask = PFM_LINESPACING;
fmt.dyLineSpacing = space;
fmt.bLineSpacingRule = rule;
richTextBox1.Select(x, 2);
SendMessage(new HandleRef(richTextBox1, richTextBox1.Handle),
EM_SETPARAFORMAT,
SCF_SELECTION,
ref fmt
);
}
Well i add this code and select ony the \n because after of "\n" start the paragraph and dosent works i dont if my logic is bad or i need to add more code
while (richTextBox1.Text.IndexOf("\n", k) > 0)
{
k = richTextBox1.Text.IndexOf("\n", k);
setLineFormat(2, 0, k);
k++;
}
.