目录
实验内容
模仿Windows的写字板,编制一个写字板并实现基本功能。
实验要求
- 利用windows forms控件编写写字板
- 可以利用该软件对文件进行输入
- 可以对选中文字进行“加粗”、“倾斜”和“加下划线”等处理
- 可以录入信息存储在默认文件在中
- 可以读取默认文件信息,如果该文件不存在则发出警告
- 代码符合编码规范
实验源码
Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Text;
namespace WindowsFormsApplicationNotePad
{
public partial class Form1 : Form
{
float ZoomFactor = 1;
bool IsModify = false;
string CurFileName = string.Empty;
int Start = 0;
public Form1()
{
InitializeComponent();
}
private void buttonBold_Click(object sender, EventArgs e)
{
SetFontStyle(FontStyle.Bold);
}
private void SetFontStyle(FontStyle style)
{
int SelectStart = richTextBoxContent.SelectionStart;
int SelectLength = richTextBoxContent.SelectionLength;
RichTextBox TempText = new RichTextBox();
TempText.Rtf = richTextBoxContent.SelectedRtf;
for (int i = 0; i < TempText.Rtf.Length; i++)
{
TempText.Select(i, 1);
TempText.SelectionFont = new Font(TempText.SelectionFont, TempText.SelectionFont.Style ^ style);
}
TempText.Select(0, TempText.Rtf.Length - 1);
richTextBoxContent.SelectedRtf = TempText.SelectedRtf;
richTextBoxContent.Select(SelectStart, SelectLength);
richTextBoxContent.Focus();
}
private void buttonItalic_Click(object sender, EventArgs e)
{
SetFontStyle(FontStyle.Italic);
}
private void buttonUnderline_Click(object sender, EventArgs e)
{
SetFontStyle(FontStyle.Underline);
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (IsModify && richTextBoxContent.Rtf.Length != 0)
{
DialogResult Result = MessageBox.Show("是否保存?", "提示", MessageBoxButtons.YesNoCancel);
if (Result == DialogResult.Yes)
{
Save();
}
else if (Result == DialogResult.No)
{
}
else if (Result == DialogResult.Cancel)
{
e.Cancel = true;
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
//获取系统已经安装的字体,添加进comboBox中
InstalledFontCollection MyFont = new InstalledFontCollection();
FontFamily[] MyFontFamilies = MyFont.Families;
int Count = MyFontFamilies.Length;
for (int i = 0; i < Count; i++)
{
comboBoxInstalledFont.Items.Add(MyFontFamilies[i].Name);
}
//获取richTextBox默认字体
comboBoxInstalledFont.SelectedItem = richTextBoxContent.Font.Name;
//获取字号
numericUpDownFontSize.Value = (decimal)richTextBoxContent.Font.Size;
}
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void 关于写字板ToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show(this,"该写字板基于C# Winform编写。","关于本写字板");
}
private void buttonDel_Click(object sender, EventArgs e)
{
SetFontStyle(FontStyle.Strikeout);
}
private void checkBoxWordWrap_CheckedChanged(object sender, EventArgs e)
{
richTextBoxContent.WordWrap = !richTextBoxContent.WordWrap;
}
private void checkBoxDrag_CheckedChanged(object sender, EventArgs e)
{
richTextBoxContent.EnableAutoDragDrop = !richTextBoxContent.EnableAutoDragDrop;
}
private void checkBoxAcceptTab_CheckedChanged(object sender, EventArgs e)
{
richTextBoxContent.AcceptsTab = !richTextBoxContent.AcceptsTab;
}
private void checkBoxHideSelection_CheckedChanged(object sender, EventArgs e)
{
richTextBoxContent.HideSelection = !richTextBoxContent.HideSelection;
}
private void buttonNormal_Click(object sender, EventArgs e)
{
richTextBoxContent.ZoomFactor = 1;
ZoomFactor = 1;
}
private void buttonZoomUp_Click(object sender, EventArgs e)
{
ZoomFactor *= 2;
if (ZoomFactor >= 64)
ZoomFactor = 63;
richTextBoxContent.ZoomFactor = ZoomFactor;
}
private void buttonZoomDown_Click(object sender, EventArgs e)
{
ZoomFactor /= 2;
if (ZoomFactor <= 0.015625)
ZoomFactor = 0.015626f;
richTextBoxContent.ZoomFactor = ZoomFactor;
}
private void comboBoxInstalledFont_SelectedIndexChanged(object sender, EventArgs e)
{
richTextBoxContent.SelectionFont = new Font(comboBoxInstalledFont.Text, (float)numericUpDownFontSize.Value);
}
private void numericUpDownFontSize_ValueChanged(object sender, EventArgs e)
{
richTextBoxContent.SelectionFont = new Font(comboBoxInstalledFont.Text, (float)numericUpDownFontSize.Value);
}
private void buttonConfirmColor_Click(object sender, EventArgs e)
{
try {
int R = Convert.ToInt32(textBoxR.Text);
int G = Convert.ToInt32(textBoxG.Text);
int B = Convert.ToInt32(textBoxB.Text);
richTextBoxContent.SelectionColor = Color.FromArgb(R, G, B);
}
catch
{
MessageBox.Show(this, "RGB值应该为0~255之间的数字。", "警告");
}
}
private void button1_Click(object sender, EventArgs e)
{
richTextBoxContent.SelectionColor = Color.White;
}
private void button2_Click(object sender, EventArgs e)
{
richTextBoxContent.SelectionColor = Color.Black;
}
private void button3_Click(object sender, EventArgs e)
{
richTextBoxContent.SelectionColor = Color.Red;
}
private void button4_Click(object sender, EventArgs e)
{
richTextBoxContent.SelectionColor = Color.Green;
}
private void button5_Click(object sender, EventArgs e)
{
richTextBoxContent.SelectionColor = Color.Blue;
}
private void button6_Click(object sender, EventArgs e)
{
richTextBoxContent.SelectionColor = Color.Yellow;
}
private void buttonPaste_Click(object sender, EventArgs e)
{
richTextBoxContent.Paste();
}
private void buttonCopy_Click(object sender, EventArgs e)
{
richTextBoxContent.Copy();
}
private void buttonCut_Click(object sender, EventArgs e)
{
richTextBoxContent.Cut();
}
private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "文本文件|*.txt|RTF文本文档|*.rtf|所有写字板文档|*.txt;*.rtf|所有文件|*.*";
openFileDialog1.FileName = "";
openFileDialog1.FilterIndex = 3;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
richTextBoxContent.Clear();
//此处我设置的写字板默认打开文件的格式是RTF文件,如果要打开TXT文件需要将下面一行的代码中的RichTextBoxStreamType.RichText改成RichTextBoxStreamType.PlainText;
richTextBoxContent.LoadFile(openFileDialog1.FileName, RichTextBoxStreamType.RichText);
CurFileName = openFileDialog1.FileName;
this.Text = "C#写字板 " + CurFileName;
Start = 0;
}
}
private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (CurFileName != string.Empty)
{
Save();
}
else
{
SaveAs();
}
}
private void Save()
{
if (CurFileName == string.Empty)
{
SaveAs();
}
else
{
if (CurFileName.EndsWith(".rtf"))
{
richTextBoxContent.SaveFile(CurFileName, RichTextBoxStreamType.RichText);
}
else
{
richTextBoxContent.SaveFile(CurFileName, RichTextBoxStreamType.PlainText);
}
IsModify = false;
this.Text = "C#写字板 " + CurFileName;
}
}
private void SaveAs()
{
SaveAs(2);
}
private void SaveAs(int Index)
{
saveFileDialog1.Filter = "文本文件|*.txt|RTF文本文档|*.rtf|所有文件|*.*";
saveFileDialog1.FilterIndex = Index;
saveFileDialog1.Title = "另存为";
saveFileDialog1.FileName = "";
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
if (saveFileDialog1.DefaultExt == ".rtf")
{
richTextBoxContent.SaveFile(saveFileDialog1.FileName, RichTextBoxStreamType.RichText);
}
else
{
richTextBoxContent.SaveFile(saveFileDialog1.FileName, RichTextBoxStreamType.PlainText);
}
if (CurFileName == string.Empty)
{
CurFileName = saveFileDialog1.FileName;
IsModify = false;
this.Text = "C#写字板 " + CurFileName;
}
}
}
private void richTextBoxContent_TextChanged(object sender, EventArgs e)
{
IsModify = true;
if (CurFileName != string.Empty)
{
this.Text = "C#写字板 " + CurFileName + " *";
}
else
{
this.Text = "C#写字板 " + "Undefined" + " *";
}
}
private void 其他格式ToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveAs();
}
private void 新建ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (IsModify)
{
DialogResult Result = MessageBox.Show("是否保存?", "提示", MessageBoxButtons.YesNoCancel);
if (Result == DialogResult.Yes)
{
Save();
richTextBoxContent.Clear();
IsModify = false;
CurFileName = string.Empty;
this.Text = "C#写字板";
Start = 0;
}
else if (Result == DialogResult.No)
{
richTextBoxContent.Clear();
IsModify = false;
CurFileName = string.Empty;
this.Text = "C#写字板";
Start = 0;
}
else if (Result == DialogResult.Cancel)
{
return;
}
}
else
{
richTextBoxContent.Clear();
IsModify = false;
CurFileName = string.Empty;
this.Text = "C#写字板";
Start = 0;
}
}
private void rTF文本文档ToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveAs(2);
}
private void 纯文本文档ToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveAs(1);
}
private void buttonPic_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "BMP文件|*.bmp|JPG文件|*.jpg|PNG文件|*.png|所有支持的图片文件|*.bmp;*.jpg;*.png|所有文件|*.*";
openFileDialog1.Title = "打开图片";
openFileDialog1.FilterIndex = 4;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
Bitmap bmp = new Bitmap(openFileDialog1.FileName);//获得图片
Clipboard.SetDataObject(bmp, false);//将图片放在剪贴板中
if (richTextBoxContent.CanPaste(DataFormats.GetFormat(DataFormats.Bitmap)))
richTextBoxContent.Paste();//粘贴数据
}
}
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
richTextBoxContent.AppendText(dateTimePicker1.Text);
}
private void buttonUndo_Click(object sender, EventArgs e)
{
if (richTextBoxContent.CanUndo)
{
richTextBoxContent.Undo();
}
}
private void buttonRedo_Click(object sender, EventArgs e)
{
if (richTextBoxContent.CanRedo)
{
richTextBoxContent.Redo();
}
}
private void buttonSearch_Click(object sender, EventArgs e)
{
int FindPos = richTextBoxContent.Find(textBoxSearchText.Text,Start + 1,RichTextBoxFinds.None);
if (FindPos >= 0)
{
Start = FindPos;
}
else
{
MessageBox.Show("没有找到!", "提示");
}
}
}
}
Form1.Designer.cs
namespace WindowsFormsApplicationNotePad
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPageHome = new System.Windows.Forms.TabPage();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.buttonRedo = new System.Windows.Forms.Button();
this.buttonUndo = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.buttonPic = new System.Windows.Forms.Button();
this.groupBoxCopy = new System.Windows.Forms.GroupBox();
this.buttonCopy = new System.Windows.Forms.Button();
this.buttonCut = new System.Windows.Forms.Button();
this.buttonPaste = new System.Windows.Forms.Button();
this.tabPageFont = new System.Windows.Forms.TabPage();
this.groupBoxColor = new System.Windows.Forms.GroupBox();
this.tabControlColor = new System.Windows.Forms.TabControl();
this.tabPageStandColor = new System.Windows.Forms.TabPage();
this.button6 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.tabPageCustomColor = new System.Windows.Forms.TabPage();
this.buttonConfirmColor = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.textBoxB = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBoxG = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.textBoxR = new System.Windows.Forms.TextBox();
this.groupBoxFont = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.numericUpDownFontSize = new System.Windows.Forms.NumericUpDown();
this.comboBoxInstalledFont = new System.Windows.Forms.ComboBox();
this.groupBoxStyle = new System.Windows.Forms.GroupBox();
this.buttonDel = new System.Windows.Forms.Button();
this.buttonBold = new System.Windows.Forms.Button();
this.buttonUnderline = new System.Windows.Forms.Button();
this.buttonItalic = new System.Windows.Forms.Button();
this.tabPageView = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.buttonNormal = new System.Windows.Forms.Button();
this.buttonZoomDown = new System.Windows.Forms.Button();
this.buttonZoomUp = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.checkBoxHideSelection = new System.Windows.Forms.CheckBox();
this.checkBoxDrag = new System.Windows.Forms.CheckBox();
this.checkBoxAcceptTab = new System.Windows.Forms.CheckBox();
this.checkBoxWordWrap = new System.Windows.Forms.CheckBox();
this.richTextBoxContent = new System.Windows.Forms.RichTextBox();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.新建ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.打开ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.另存为ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.rTF文本文档ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.纯文本文档ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.其他格式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.打印ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.打印ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.快速打印ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.打印预览ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.页面设置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.在电子邮件中发送ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.关于写字板ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.textBoxSearchText = new System.Windows.Forms.TextBox();
this.buttonSearch = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPageHome.SuspendLayout();
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBoxCopy.SuspendLayout();
this.tabPageFont.SuspendLayout();
this.groupBoxColor.SuspendLayout();
this.tabControlColor.SuspendLayout();
this.tabPageStandColor.SuspendLayout();
this.tabPageCustomColor.SuspendLayout();
this.groupBoxFont.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownFontSize)).BeginInit();
this.groupBoxStyle.SuspendLayout();
this.tabPageView.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Controls.Add(this.tabPageHome);
this.tabControl1.Controls.Add(this.tabPageFont);
this.tabControl1.Controls.Add(this.tabPageView);
this.tabControl1.Location = new System.Drawing.Point(13, 32);
this.tabControl1.Multiline = true;
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(659, 128);
this.tabControl1.TabIndex = 0;
//
// tabPageHome
//
this.tabPageHome.Controls.Add(this.groupBox4);
this.tabPageHome.Controls.Add(this.groupBox3);
this.tabPageHome.Controls.Add(this.groupBoxCopy);
this.tabPageHome.Location = new System.Drawing.Point(4, 22);
this.tabPageHome.Name = "tabPageHome";
this.tabPageHome.Padding = new System.Windows.Forms.Padding(3);
this.tabPageHome.Size = new System.Drawing.Size(651, 102);
this.tabPageHome.TabIndex = 1;
this.tabPageHome.Text = "主页";
this.tabPageHome.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.buttonSearch);
this.groupBox4.Controls.Add(this.textBoxSearchText);
this.groupBox4.Controls.Add(this.buttonRedo);
this.groupBox4.Controls.Add(this.buttonUndo);
this.groupBox4.Location = new System.Drawing.Point(360, 7);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(177, 87);
this.groupBox4.TabIndex = 2;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "编辑";
//
// buttonRedo
//
this.buttonRedo.Location = new System.Drawing.Point(89, 20);
this.buttonRedo.Name = "buttonRedo";
this.buttonRedo.Size = new System.Drawing.Size(75, 23);
this.buttonRedo.TabIndex = 1;
this.buttonRedo.Text = "重复";
this.buttonRedo.UseVisualStyleBackColor = true;
this.buttonRedo.Click += new System.EventHandler(this.buttonRedo_Click);
//
// buttonUndo
//
this.buttonUndo.Location = new System.Drawing.Point(7, 21);
this.buttonUndo.Name = "buttonUndo";
this.buttonUndo.Size = new System.Drawing.Size(75, 23);
this.buttonUndo.TabIndex = 0;
this.buttonUndo.Text = "撤销";
this.buttonUndo.UseVisualStyleBackColor = true;
this.buttonUndo.Click += new System.EventHandler(this.buttonUndo_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.dateTimePicker1);
this.groupBox3.Controls.Add(this.buttonPic);
this.groupBox3.Location = new System.Drawing.Point(189, 7);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(139, 87);
this.groupBox3.TabIndex = 1;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "插入";
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(16, 53);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(108, 21);
this.dateTimePicker1.TabIndex = 1;
this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged);
//
// buttonPic
//
this.buttonPic.Location = new System.Drawing.Point(16, 21);
this.buttonPic.Name = "buttonPic";
this.buttonPic.Size = new System.Drawing.Size(108, 23);
this.buttonPic.TabIndex = 0;
this.buttonPic.Text = "图片";
this.buttonPic.UseVisualStyleBackColor = true;
this.buttonPic.Click += new System.EventHandler(this.buttonPic_Click);
//
// groupBoxCopy
//
this.groupBoxCopy.Controls.Add(this.buttonCopy);
this.groupBoxCopy.Controls.Add(this.buttonCut);
this.groupBoxCopy.Controls.Add(this.buttonPaste);
this.groupBoxCopy.Location = new System.Drawing.Point(7, 7);
this.groupBoxCopy.Name = "groupBoxCopy";
this.groupBoxCopy.Size = new System.Drawing.Size(147, 87);
this.groupBoxCopy.TabIndex = 0;
this.groupBoxCopy.TabStop = false;
this.groupBoxCopy.Text = "剪贴板";
//
// buttonCopy
//
this.buttonCopy.Location = new System.Drawing.Point(84, 51);
this.buttonCopy.Name = "buttonCopy";
this.buttonCopy.Size = new System.Drawing.Size(48, 23);
this.buttonCopy.TabIndex = 2;
this.buttonCopy.Text = "复制";
this.buttonCopy.UseVisualStyleBackColor = true;
this.buttonCopy.Click += new System.EventHandler(this.buttonCopy_Click);
//
// buttonCut
//
this.buttonCut.Location = new System.Drawing.Point(84, 21);
this.buttonCut.Name = "buttonCut";
this.buttonCut.Size = new System.Drawing.Size(48, 23);
this.buttonCut.TabIndex = 1;
this.buttonCut.Text = "剪切";
this.buttonCut.UseVisualStyleBackColor = true;
this.buttonCut.Click += new System.EventHandler(this.buttonCut_Click);
//
// buttonPaste
//
this.buttonPaste.Location = new System.Drawing.Point(6, 21);
this.buttonPaste.Name = "buttonPaste";
this.buttonPaste.Size = new System.Drawing.Size(65, 50);
this.buttonPaste.TabIndex = 0;
this.buttonPaste.Text = "粘贴";
this.buttonPaste.UseVisualStyleBackColor = true;
this.buttonPaste.Click += new System.EventHandler(this.buttonPaste_Click);
//
// tabPageFont
//
this.tabPageFont.Controls.Add(this.groupBoxColor);
this.tabPageFont.Controls.Add(this.groupBoxFont);
this.tabPageFont.Controls.Add(this.groupBoxStyle);
this.tabPageFont.Location = new System.Drawing.Point(4, 22);
this.tabPageFont.Name = "tabPageFont";
this.tabPageFont.Padding = new System.Windows.Forms.Padding(3);
this.tabPageFont.Size = new System.Drawing.Size(651, 102);
this.tabPageFont.TabIndex = 0;
this.tabPageFont.Text = "字体";
this.tabPageFont.UseVisualStyleBackColor = true;
//
// groupBoxColor
//
this.groupBoxColor.Controls.Add(this.tabControlColor);
this.groupBoxColor.Location = new System.Drawing.Point(320, 7);
this.groupBoxColor.Name = "groupBoxColor";
this.groupBoxColor.Size = new System.Drawing.Size(273, 90);
this.groupBoxColor.TabIndex = 8;
this.groupBoxColor.TabStop = false;
this.groupBoxColor.Text = "颜色";
//
// tabControlColor
//
this.tabControlColor.Controls.Add(this.tabPageStandColor);
this.tabControlColor.Controls.Add(this.tabPageCustomColor);
this.tabControlColor.Location = new System.Drawing.Point(7, 16);
this.tabControlColor.Name = "tabControlColor";
this.tabControlColor.SelectedIndex = 0;
this.tabControlColor.Size = new System.Drawing.Size(260, 68);
this.tabControlColor.TabIndex = 0;
//
// tabPageStandColor
//
this.tabPageStandColor.Controls.Add(this.button6);
this.tabPageStandColor.Controls.Add(this.button5);
this.tabPageStandColor.Controls.Add(this.button4);
this.tabPageStandColor.Controls.Add(this.button3);
this.tabPageStandColor.Controls.Add(this.button2);
this.tabPageStandColor.Controls.Add(this.button1);
this.tabPageStandColor.Location = new System.Drawing.Point(4, 22);
this.tabPageStandColor.Name = "tabPageStandColor";
this.tabPageStandColor.Padding = new System.Windows.Forms.Padding(3);
this.tabPageStandColor.Size = new System.Drawing.Size(252, 42);
this.tabPageStandColor.TabIndex = 0;
this.tabPageStandColor.Text = "标准颜色";
this.tabPageStandColor.UseVisualStyleBackColor = true;
//
// button6
//
this.button6.BackColor = System.Drawing.Color.Yellow;
this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button6.Location = new System.Drawing.Point(201, 11);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(33, 23);
this.button6.TabIndex = 5;
this.button6.UseVisualStyleBackColor = false;
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// button5
//
this.button5.BackColor = System.Drawing.Color.Blue;
this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button5.Location = new System.Drawing.Point(162, 11);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(33, 23);
this.button5.TabIndex = 4;
this.button5.UseVisualStyleBackColor = false;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// button4
//
this.button4.BackColor = System.Drawing.Color.Green;
this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button4.Location = new System.Drawing.Point(123, 11);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(33, 23);
this.button4.TabIndex = 3;
this.button4.UseVisualStyleBackColor = false;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button3
//
this.button3.BackColor = System.Drawing.Color.Red;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Location = new System.Drawing.Point(84, 11);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(33, 23);
this.button3.TabIndex = 2;
this.button3.UseVisualStyleBackColor = false;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button2
//
this.button2.BackColor = System.Drawing.Color.Black;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Location = new System.Drawing.Point(45, 11);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(33, 23);
this.button2.TabIndex = 1;
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.White;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(6, 11);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(33, 23);
this.button1.TabIndex = 0;
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// tabPageCustomColor
//
this.tabPageCustomColor.Controls.Add(this.buttonConfirmColor);
this.tabPageCustomColor.Controls.Add(this.label4);
this.tabPageCustomColor.Controls.Add(this.textBoxB);
this.tabPageCustomColor.Controls.Add(this.label3);
this.tabPageCustomColor.Controls.Add(this.textBoxG);
this.tabPageCustomColor.Controls.Add(this.label2);
this.tabPageCustomColor.Controls.Add(this.textBoxR);
this.tabPageCustomColor.Location = new System.Drawing.Point(4, 22);
this.tabPageCustomColor.Name = "tabPageCustomColor";
this.tabPageCustomColor.Padding = new System.Windows.Forms.Padding(3);
this.tabPageCustomColor.Size = new System.Drawing.Size(252, 42);
this.tabPageCustomColor.TabIndex = 1;
this.tabPageCustomColor.Text = "自定义颜色";
this.tabPageCustomColor.UseVisualStyleBackColor = true;
//
// buttonConfirmColor
//
this.buttonConfirmColor.Location = new System.Drawing.Point(171, 16);
this.buttonConfirmColor.Name = "buttonConfirmColor";
this.buttonConfirmColor.Size = new System.Drawing.Size(75, 23);
this.buttonConfirmColor.TabIndex = 6;
this.buttonConfirmColor.Text = "确定颜色";
this.buttonConfirmColor.UseVisualStyleBackColor = true;
this.buttonConfirmColor.Click += new System.EventHandler(this.buttonConfirmColor_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(115, 15);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(17, 12);
this.label4.TabIndex = 5;
this.label4.Text = "B:";
//
// textBoxB
//
this.textBoxB.Location = new System.Drawing.Point(133, 15);
this.textBoxB.MaxLength = 3;
this.textBoxB.Name = "textBoxB";
this.textBoxB.Size = new System.Drawing.Size(26, 21);
this.textBoxB.TabIndex = 4;
this.textBoxB.WordWrap = false;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(60, 15);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(17, 12);
this.label3.TabIndex = 3;
this.label3.Text = "G:";
//
// textBoxG
//
this.textBoxG.Location = new System.Drawing.Point(78, 15);
this.textBoxG.MaxLength = 3;
this.textBoxG.Name = "textBoxG";
this.textBoxG.Size = new System.Drawing.Size(26, 21);
this.textBoxG.TabIndex = 2;
this.textBoxG.WordWrap = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(7, 15);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(17, 12);
this.label2.TabIndex = 1;
this.label2.Text = "R:";
//
// textBoxR
//
this.textBoxR.Location = new System.Drawing.Point(25, 15);
this.textBoxR.MaxLength = 3;
this.textBoxR.Name = "textBoxR";
this.textBoxR.Size = new System.Drawing.Size(26, 21);
this.textBoxR.TabIndex = 0;
this.textBoxR.WordWrap = false;
//
// groupBoxFont
//
this.groupBoxFont.Controls.Add(this.label1);
this.groupBoxFont.Controls.Add(this.numericUpDownFontSize);
this.groupBoxFont.Controls.Add(this.comboBoxInstalledFont);
this.groupBoxFont.Location = new System.Drawing.Point(174, 7);
this.groupBoxFont.Name = "groupBoxFont";
this.groupBoxFont.Size = new System.Drawing.Size(123, 90);
this.groupBoxFont.TabIndex = 7;
this.groupBoxFont.TabStop = false;
this.groupBoxFont.Text = "字体";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 54);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 2;
this.label1.Text = "字号:";
//
// numericUpDownFontSize
//
this.numericUpDownFontSize.Location = new System.Drawing.Point(60, 54);
this.numericUpDownFontSize.Maximum = new decimal(new int[] {
1638,
0,
0,
0});
this.numericUpDownFontSize.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownFontSize.Name = "numericUpDownFontSize";
this.numericUpDownFontSize.Size = new System.Drawing.Size(50, 21);
this.numericUpDownFontSize.TabIndex = 1;
this.numericUpDownFontSize.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownFontSize.ValueChanged += new System.EventHandler(this.numericUpDownFontSize_ValueChanged);
//
// comboBoxInstalledFont
//
this.comboBoxInstalledFont.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxInstalledFont.FormattingEnabled = true;
this.comboBoxInstalledFont.Location = new System.Drawing.Point(7, 16);
this.comboBoxInstalledFont.Name = "comboBoxInstalledFont";
this.comboBoxInstalledFont.Size = new System.Drawing.Size(103, 20);
this.comboBoxInstalledFont.TabIndex = 0;
this.comboBoxInstalledFont.SelectedIndexChanged += new System.EventHandler(this.comboBoxInstalledFont_SelectedIndexChanged);
//
// groupBoxStyle
//
this.groupBoxStyle.Controls.Add(this.buttonDel);
this.groupBoxStyle.Controls.Add(this.buttonBold);
this.groupBoxStyle.Controls.Add(this.buttonUnderline);
this.groupBoxStyle.Controls.Add(this.buttonItalic);
this.groupBoxStyle.Location = new System.Drawing.Point(6, 7);
this.groupBoxStyle.Name = "groupBoxStyle";
this.groupBoxStyle.Size = new System.Drawing.Size(147, 90);
this.groupBoxStyle.TabIndex = 6;
this.groupBoxStyle.TabStop = false;
this.groupBoxStyle.Text = "风格";
//
// buttonDel
//
this.buttonDel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.buttonDel.Location = new System.Drawing.Point(74, 54);
this.buttonDel.Name = "buttonDel";
this.buttonDel.Size = new System.Drawing.Size(54, 23);
this.buttonDel.TabIndex = 6;
this.buttonDel.Text = "删除线";
this.buttonDel.UseVisualStyleBackColor = true;
this.buttonDel.Click += new System.EventHandler(this.buttonDel_Click);
//
// buttonBold
//
this.buttonBold.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.buttonBold.Location = new System.Drawing.Point(6, 16);
this.buttonBold.Name = "buttonBold";
this.buttonBold.Size = new System.Drawing.Size(62, 24);
this.buttonBold.TabIndex = 3;
this.buttonBold.Text = "加粗";
this.buttonBold.UseVisualStyleBackColor = true;
this.buttonBold.Click += new System.EventHandler(this.buttonBold_Click);
//
// buttonUnderline
//
this.buttonUnderline.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.buttonUnderline.Location = new System.Drawing.Point(74, 16);
this.buttonUnderline.Name = "buttonUnderline";
this.buttonUnderline.Size = new System.Drawing.Size(55, 24);
this.buttonUnderline.TabIndex = 5;
this.buttonUnderline.Text = "下划线";
this.buttonUnderline.UseVisualStyleBackColor = true;
this.buttonUnderline.Click += new System.EventHandler(this.buttonUnderline_Click);
//
// buttonItalic
//
this.buttonItalic.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.buttonItalic.Location = new System.Drawing.Point(6, 54);
this.buttonItalic.Name = "buttonItalic";
this.buttonItalic.Size = new System.Drawing.Size(62, 24);
this.buttonItalic.TabIndex = 4;
this.buttonItalic.Text = "斜体";
this.buttonItalic.UseVisualStyleBackColor = true;
this.buttonItalic.Click += new System.EventHandler(this.buttonItalic_Click);
//
// tabPageView
//
this.tabPageView.Controls.Add(this.groupBox2);
this.tabPageView.Controls.Add(this.groupBox1);
this.tabPageView.Location = new System.Drawing.Point(4, 22);
this.tabPageView.Name = "tabPageView";
this.tabPageView.Size = new System.Drawing.Size(651, 102);
this.tabPageView.TabIndex = 2;
this.tabPageView.Text = "查看";
this.tabPageView.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.buttonNormal);
this.groupBox2.Controls.Add(this.buttonZoomDown);
this.groupBox2.Controls.Add(this.buttonZoomUp);
this.groupBox2.Location = new System.Drawing.Point(248, 12);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(178, 76);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "缩放";
//
// buttonNormal
//
this.buttonNormal.Location = new System.Drawing.Point(89, 20);
this.buttonNormal.Name = "buttonNormal";
this.buttonNormal.Size = new System.Drawing.Size(75, 48);
this.buttonNormal.TabIndex = 2;
this.buttonNormal.Text = "100%";
this.buttonNormal.UseVisualStyleBackColor = true;
this.buttonNormal.Click += new System.EventHandler(this.buttonNormal_Click);
//
// buttonZoomDown
//
this.buttonZoomDown.Location = new System.Drawing.Point(7, 45);
this.buttonZoomDown.Name = "buttonZoomDown";
this.buttonZoomDown.Size = new System.Drawing.Size(75, 23);
this.buttonZoomDown.TabIndex = 1;
this.buttonZoomDown.Text = "缩小";
this.buttonZoomDown.UseVisualStyleBackColor = true;
this.buttonZoomDown.Click += new System.EventHandler(this.buttonZoomDown_Click);
//
// buttonZoomUp
//
this.buttonZoomUp.Location = new System.Drawing.Point(7, 18);
this.buttonZoomUp.Name = "buttonZoomUp";
this.buttonZoomUp.Size = new System.Drawing.Size(75, 23);
this.buttonZoomUp.TabIndex = 0;
this.buttonZoomUp.Text = "放大";
this.buttonZoomUp.UseVisualStyleBackColor = true;
this.buttonZoomUp.Click += new System.EventHandler(this.buttonZoomUp_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.checkBoxHideSelection);
this.groupBox1.Controls.Add(this.checkBoxDrag);
this.groupBox1.Controls.Add(this.checkBoxAcceptTab);
this.groupBox1.Controls.Add(this.checkBoxWordWrap);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(217, 76);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "设置";
//
// checkBoxHideSelection
//
this.checkBoxHideSelection.AutoSize = true;
this.checkBoxHideSelection.Location = new System.Drawing.Point(95, 42);
this.checkBoxHideSelection.Name = "checkBoxHideSelection";
this.checkBoxHideSelection.Size = new System.Drawing.Size(96, 16);
this.checkBoxHideSelection.TabIndex = 3;
this.checkBoxHideSelection.Text = "隐藏选择内容";
this.checkBoxHideSelection.UseVisualStyleBackColor = true;
this.checkBoxHideSelection.CheckedChanged += new System.EventHandler(this.checkBoxHideSelection_CheckedChanged);
//
// checkBoxDrag
//
this.checkBoxDrag.AutoSize = true;
this.checkBoxDrag.Checked = true;
this.checkBoxDrag.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxDrag.Location = new System.Drawing.Point(95, 19);
this.checkBoxDrag.Name = "checkBoxDrag";
this.checkBoxDrag.Size = new System.Drawing.Size(72, 16);
this.checkBoxDrag.TabIndex = 2;
this.checkBoxDrag.Text = "启用拖放";
this.checkBoxDrag.UseVisualStyleBackColor = true;
this.checkBoxDrag.CheckedChanged += new System.EventHandler(this.checkBoxDrag_CheckedChanged);
//
// checkBoxAcceptTab
//
this.checkBoxAcceptTab.AutoSize = true;
this.checkBoxAcceptTab.Checked = true;
this.checkBoxAcceptTab.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxAcceptTab.Location = new System.Drawing.Point(16, 43);
this.checkBoxAcceptTab.Name = "checkBoxAcceptTab";
this.checkBoxAcceptTab.Size = new System.Drawing.Size(66, 16);
this.checkBoxAcceptTab.TabIndex = 1;
this.checkBoxAcceptTab.Text = "接收Tab";
this.checkBoxAcceptTab.UseVisualStyleBackColor = true;
this.checkBoxAcceptTab.CheckedChanged += new System.EventHandler(this.checkBoxAcceptTab_CheckedChanged);
//
// checkBoxWordWrap
//
this.checkBoxWordWrap.AutoSize = true;
this.checkBoxWordWrap.Checked = true;
this.checkBoxWordWrap.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxWordWrap.Location = new System.Drawing.Point(16, 20);
this.checkBoxWordWrap.Name = "checkBoxWordWrap";
this.checkBoxWordWrap.Size = new System.Drawing.Size(72, 16);
this.checkBoxWordWrap.TabIndex = 0;
this.checkBoxWordWrap.Text = "自动换行";
this.checkBoxWordWrap.UseVisualStyleBackColor = true;
this.checkBoxWordWrap.CheckedChanged += new System.EventHandler(this.checkBoxWordWrap_CheckedChanged);
//
// richTextBoxContent
//
this.richTextBoxContent.AcceptsTab = true;
this.richTextBoxContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.richTextBoxContent.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBoxContent.EnableAutoDragDrop = true;
this.richTextBoxContent.HideSelection = false;
this.richTextBoxContent.ImeMode = System.Windows.Forms.ImeMode.On;
this.richTextBoxContent.Location = new System.Drawing.Point(13, 167);
this.richTextBoxContent.Name = "richTextBoxContent";
this.richTextBoxContent.Size = new System.Drawing.Size(659, 341);
this.richTextBoxContent.TabIndex = 1;
this.richTextBoxContent.Text = "";
this.richTextBoxContent.TextChanged += new System.EventHandler(this.richTextBoxContent_TextChanged);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.文件ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(690, 25);
this.menuStrip1.TabIndex = 2;
this.menuStrip1.Text = "menuStrip1";
//
// 文件ToolStripMenuItem
//
this.文件ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.新建ToolStripMenuItem,
this.打开ToolStripMenuItem,
this.保存ToolStripMenuItem,
this.另存为ToolStripMenuItem,
this.toolStripSeparator1,
this.打印ToolStripMenuItem,
this.页面设置ToolStripMenuItem,
this.在电子邮件中发送ToolStripMenuItem,
this.toolStripSeparator2,
this.关于写字板ToolStripMenuItem,
this.退出ToolStripMenuItem});
this.文件ToolStripMenuItem.Name = "文件ToolStripMenuItem";
this.文件ToolStripMenuItem.Size = new System.Drawing.Size(44, 21);
this.文件ToolStripMenuItem.Text = "文件";
//
// 新建ToolStripMenuItem
//
this.新建ToolStripMenuItem.Name = "新建ToolStripMenuItem";
this.新建ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.新建ToolStripMenuItem.Text = "新建";
this.新建ToolStripMenuItem.Click += new System.EventHandler(this.新建ToolStripMenuItem_Click);
//
// 打开ToolStripMenuItem
//
this.打开ToolStripMenuItem.Name = "打开ToolStripMenuItem";
this.打开ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.打开ToolStripMenuItem.Text = "打开";
this.打开ToolStripMenuItem.Click += new System.EventHandler(this.打开ToolStripMenuItem_Click);
//
// 保存ToolStripMenuItem
//
this.保存ToolStripMenuItem.Name = "保存ToolStripMenuItem";
this.保存ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.保存ToolStripMenuItem.Text = "保存";
this.保存ToolStripMenuItem.Click += new System.EventHandler(this.保存ToolStripMenuItem_Click);
//
// 另存为ToolStripMenuItem
//
this.另存为ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.rTF文本文档ToolStripMenuItem,
this.纯文本文档ToolStripMenuItem,
this.其他格式ToolStripMenuItem});
this.另存为ToolStripMenuItem.Name = "另存为ToolStripMenuItem";
this.另存为ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.另存为ToolStripMenuItem.Text = "另存为";
//
// rTF文本文档ToolStripMenuItem
//
this.rTF文本文档ToolStripMenuItem.Name = "rTF文本文档ToolStripMenuItem";
this.rTF文本文档ToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.rTF文本文档ToolStripMenuItem.Text = "RTF文本文档";
this.rTF文本文档ToolStripMenuItem.Click += new System.EventHandler(this.rTF文本文档ToolStripMenuItem_Click);
//
// 纯文本文档ToolStripMenuItem
//
this.纯文本文档ToolStripMenuItem.Name = "纯文本文档ToolStripMenuItem";
this.纯文本文档ToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.纯文本文档ToolStripMenuItem.Text = "纯文本文档";
this.纯文本文档ToolStripMenuItem.Click += new System.EventHandler(this.纯文本文档ToolStripMenuItem_Click);
//
// 其他格式ToolStripMenuItem
//
this.其他格式ToolStripMenuItem.Name = "其他格式ToolStripMenuItem";
this.其他格式ToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
this.其他格式ToolStripMenuItem.Text = "其他格式";
this.其他格式ToolStripMenuItem.Click += new System.EventHandler(this.其他格式ToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(169, 6);
//
// 打印ToolStripMenuItem
//
this.打印ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.打印ToolStripMenuItem1,
this.快速打印ToolStripMenuItem,
this.打印预览ToolStripMenuItem});
this.打印ToolStripMenuItem.Enabled = false;
this.打印ToolStripMenuItem.Name = "打印ToolStripMenuItem";
this.打印ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.打印ToolStripMenuItem.Text = "打印";
//
// 打印ToolStripMenuItem1
//
this.打印ToolStripMenuItem1.Name = "打印ToolStripMenuItem1";
this.打印ToolStripMenuItem1.Size = new System.Drawing.Size(124, 22);
this.打印ToolStripMenuItem1.Text = "打印";
//
// 快速打印ToolStripMenuItem
//
this.快速打印ToolStripMenuItem.Name = "快速打印ToolStripMenuItem";
this.快速打印ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.快速打印ToolStripMenuItem.Text = "快速打印";
//
// 打印预览ToolStripMenuItem
//
this.打印预览ToolStripMenuItem.Name = "打印预览ToolStripMenuItem";
this.打印预览ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.打印预览ToolStripMenuItem.Text = "打印预览";
//
// 页面设置ToolStripMenuItem
//
this.页面设置ToolStripMenuItem.Enabled = false;
this.页面设置ToolStripMenuItem.Name = "页面设置ToolStripMenuItem";
this.页面设置ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.页面设置ToolStripMenuItem.Text = "页面设置";
//
// 在电子邮件中发送ToolStripMenuItem
//
this.在电子邮件中发送ToolStripMenuItem.Enabled = false;
this.在电子邮件中发送ToolStripMenuItem.Name = "在电子邮件中发送ToolStripMenuItem";
this.在电子邮件中发送ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.在电子邮件中发送ToolStripMenuItem.Text = "在电子邮件中发送";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(169, 6);
//
// 关于写字板ToolStripMenuItem
//
this.关于写字板ToolStripMenuItem.Name = "关于写字板ToolStripMenuItem";
this.关于写字板ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.关于写字板ToolStripMenuItem.Text = "关于写字板";
this.关于写字板ToolStripMenuItem.Click += new System.EventHandler(this.关于写字板ToolStripMenuItem_Click);
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// textBoxSearchText
//
this.textBoxSearchText.Location = new System.Drawing.Point(7, 51);
this.textBoxSearchText.Name = "textBoxSearchText";
this.textBoxSearchText.Size = new System.Drawing.Size(75, 21);
this.textBoxSearchText.TabIndex = 2;
//
// buttonSearch
//
this.buttonSearch.Location = new System.Drawing.Point(89, 51);
this.buttonSearch.Name = "buttonSearch";
this.buttonSearch.Size = new System.Drawing.Size(75, 23);
this.buttonSearch.TabIndex = 3;
this.buttonSearch.Text = "查找";
this.buttonSearch.UseVisualStyleBackColor = true;
this.buttonSearch.Click += new System.EventHandler(this.buttonSearch_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(690, 520);
this.Controls.Add(this.richTextBoxContent);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
this.Text = "C#写字板";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.tabControl1.ResumeLayout(false);
this.tabPageHome.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBoxCopy.ResumeLayout(false);
this.tabPageFont.ResumeLayout(false);
this.groupBoxColor.ResumeLayout(false);
this.tabControlColor.ResumeLayout(false);
this.tabPageStandColor.ResumeLayout(false);
this.tabPageCustomColor.ResumeLayout(false);
this.tabPageCustomColor.PerformLayout();
this.groupBoxFont.ResumeLayout(false);
this.groupBoxFont.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownFontSize)).EndInit();
this.groupBoxStyle.ResumeLayout(false);
this.tabPageView.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPageFont;
private System.Windows.Forms.TabPage tabPageHome;
private System.Windows.Forms.TabPage tabPageView;
private System.Windows.Forms.RichTextBox richTextBoxContent;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem 文件ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 新建ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 打开ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 保存ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 另存为ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem rTF文本文档ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 纯文本文档ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 其他格式ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem 打印ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 打印ToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem 快速打印ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 打印预览ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 页面设置ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 在电子邮件中发送ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem 关于写字板ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
private System.Windows.Forms.Button buttonUnderline;
private System.Windows.Forms.Button buttonItalic;
private System.Windows.Forms.Button buttonBold;
private System.Windows.Forms.GroupBox groupBoxCopy;
private System.Windows.Forms.Button buttonCopy;
private System.Windows.Forms.Button buttonCut;
private System.Windows.Forms.Button buttonPaste;
private System.Windows.Forms.GroupBox groupBoxStyle;
private System.Windows.Forms.Button buttonDel;
private System.Windows.Forms.GroupBox groupBoxFont;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.NumericUpDown numericUpDownFontSize;
private System.Windows.Forms.ComboBox comboBoxInstalledFont;
private System.Windows.Forms.GroupBox groupBoxColor;
private System.Windows.Forms.TabControl tabControlColor;
private System.Windows.Forms.TabPage tabPageStandColor;
private System.Windows.Forms.TabPage tabPageCustomColor;
private System.Windows.Forms.Button buttonConfirmColor;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBoxB;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBoxG;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBoxR;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox checkBoxAcceptTab;
private System.Windows.Forms.CheckBox checkBoxWordWrap;
private System.Windows.Forms.CheckBox checkBoxDrag;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button buttonNormal;
private System.Windows.Forms.Button buttonZoomDown;
private System.Windows.Forms.Button buttonZoomUp;
private System.Windows.Forms.CheckBox checkBoxHideSelection;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button buttonPic;
private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.Button buttonRedo;
private System.Windows.Forms.Button buttonUndo;
private System.Windows.Forms.Button buttonSearch;
private System.Windows.Forms.TextBox textBoxSearchText;
}
}
Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplicationNotePad
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
效果展示