0

When I use formatting functions (i-e bold, italic, underline, font size, font color), then the the whole document is formatted including the new text entered. But I want to use these functionalities only to format new text that is going to be entered and the selected text.

How can I do this?

LarsTech
  • 79,075
  • 14
  • 143
  • 215

1 Answers1

0

The problem can be resolve by using this code:

System.Drawing.Font currentFont = txtPAD.SelectionFont;

System.Drawing.FontStyle newFontStyle;

newFontStyle = txtPAD.SelectionFont.Style ^ FontStyle.Italic;

txtPAD.SelectionFont = new Font(currentFont.FontFamily, currentFont.Size, newFontStyle);
Code Lღver
  • 15,434
  • 16
  • 54
  • 74