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
{
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
相关文章推荐
- 利用C#的指针编写都一个简单链表
- C#实现一个简单实用的TXT文本操作及日志框架详解
- C#大作业一个简单的编辑器
- 利用C#编写一个简单的抓网页应用程序
- c#学习笔记之九 事件(event)的使用,一个简单的例子揭示其设计理念
- C#利用事件与委托进行窗体间传值简单小例子
- 一个最简单的C#事件例子
- C#事件演示程序1)——一个最简单的C#事件处理程序
- C# 实现简单打印(二)-打印一个文本文档,打印的内容是多行的
- 利用C#编写一个简单的抓网页应用程序
- 利用C#编写一个简单的抓网页应用程序
- wxPython一个简单文本编辑器
- 一个C# 事件的简单例子
- 利用C#编写一个简单的抓网页应用程序
- 【Java】使用JFrame监听事件创建一个复制文本功能的窗体程序与按钮快捷键
- C#大作业一个简单的编辑器
- 一个C#简单事件代理
- 自己写的一个简单文本批量编辑器, 附源码
- 利用C#编写一个简单的抓网页应用程序
- 一个简单的C#多线程间同步(事件方法)的例子