您的位置:首页 > 编程语言 > C#

C#简单文本编辑器(利用ToolStrip、enu、一个事件多个监听等)

2009-01-31 17:36 351 查看
private void SetStyle(object sender,EventArgs e)
{
ToolStripButton btn = sender as ToolStripButton;
FontStyle fontStyleContent = this.rchTxtContent.SelectionFont.Style;
FontStyle BtnFont = ( FontStyle)(Enum.Parse(typeof(FontStyle),btn.Tag.ToString()));
if ((fontStyleContent | BtnFont) == fontStyleContent)
{
fontStyleContent = ~BtnFont & fontStyleContent;
}
else
{
fontStyleContent = fontStyleContent | BtnFont;
}

this.rchTxtContent.SelectionFont = new Font(
this.rchTxtContent.SelectionFont.FontFamily,
this.rchTxtContent.SelectionFont.Size,
fontStyleContent,
this.rchTxtContent.SelectionFont.Unit
);

}
源代码下载地址:http://files.cnblogs.com/beniao/enumExample.rar
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: