private void button1_Click(object sender, System.EventArgs e)
{
fontDialog1.ShowColor = true;
if(fontDialog1.ShowDialog() != DialogResult.Cancel )
{
richTextBox1.SelectionProtected=false;
richTextBox1.SelectionFont=fontDialog1.Font;
richTextBox1.SelectionColor=fontDialog1.Color;
}
richTextBox1.SelectionProtected=true;
}
private void richTextBox1_Protected(object sender, System.EventArgs e)
{
richTextBox1.SelectionProtected=false;
}这样就可以解决你的问题了。^_^
{
fontDialog1.ShowColor = true;
if(fontDialog1.ShowDialog() != DialogResult.Cancel )
{
richTextBox1.SelectionProtected=false;
richTextBox1.SelectionFont=fontDialog1.Font;
richTextBox1.SelectionColor=fontDialog1.Color;
}
richTextBox1.SelectionProtected=true;
}
private void richTextBox1_Protected(object sender, System.EventArgs e)
{
richTextBox1.SelectionProtected=false;
}这样就可以解决你的问题了。^_^
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货