using System; using System
Collections
Generic; using System
ComponentModel; using System
Data; using System
Drawing; using System
Linq; using System
Text; using System
Windows
Forms; using System
IO; namespace 记事本 { public partial class notebook : Form { #region 初始变量 bool Status = false;//状态栏的显示状态 bool WordWrap = false;//显示是否自动换行 bool newnote = true;//是否是新建文档 string str = "";//中间变量,判断文本框的值是否改变 bool RighttoLeft = false;//是否从右向左读 public notebook() { InitializeComponent(); }//窗体的初始化 #endregion #region 文件 //实现创建一个新的文本功能 private void 新建NToolStripMenuItem_Click( object sender, EventArgs e) { try { //如果是新建文档,按以下方式 if (newnote) { if (richTextBox1
= "") { DialogResult r = MessageBox
Show(" 是否将更改保存到 无标题
" , "记事本" , MessageBoxButtons
YesNoCancel, MessageBoxIcon
Question); int g = (int)r; if (g