以设置粗体为例
private void btnBold_Click(object sender, EventArgs e) { Font oldFont; Font newFont; oldFont = this.rtftext.SelectionFont; if (oldFont.Bold) { newFont = new Font(oldFont, oldFont.Style &~FontStyle.Bold); } else newFont = new Font(oldFont,oldFont.Style|FontStyle.Bold); this.rtftext.SelectionFont = newFont; this.rtftext.Focus(); }