现在我正在使用一些带有以下代码的按钮:
richTextBox1.SelectionFont = new Font("Tahoma", 12, FontStyle.Bold);
richTextBox1.SelectionColor = System.Drawing.Color.Red;
Run Code Online (Sandbox Code Playgroud)
我还想使用以下方法添加一些粗体、斜体等按钮:
richTextBox1.SelectionFont = new Font("Tahoma", 12, FontStyle.Italic);
Run Code Online (Sandbox Code Playgroud)
但如果我有粗体选项,此代码将删除粗体并添加斜体。如何保留粗体和斜体?
谢谢!