📄 frmonlyfile.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using DataAccessLayer;
namespace PersonalInfo
{
/// <summary>
/// frmOnlyFile 的摘要说明。
/// </summary>
public class frmOnlyFile : System.Windows.Forms.Form
{
#region Windows 窗体设计器生成的代码
public System.Windows.Forms.Panel pnlOnlyFile;
private PublicUIComponent.SuperRichTextBox txtFileDetail;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtFile;
private System.Windows.Forms.Button btnOpen;
private System.Windows.Forms.Button btnSaveFile;
private System.Windows.Forms.Button btnDeleteFile;
private System.Windows.Forms.Button btnExportFile;
private System.Windows.Forms.LinkLabel lnkSetBold;
private System.Windows.Forms.LinkLabel lnkItalic;
private System.Windows.Forms.LinkLabel lnkFontSizeUp;
private System.Windows.Forms.LinkLabel lnkFontSizeDown;
private System.Windows.Forms.LinkLabel lnkSelectFont;
private System.Windows.Forms.LinkLabel lnkCut;
private System.Windows.Forms.LinkLabel lnkCopy;
private System.Windows.Forms.LinkLabel lnkPaste;
private System.Windows.Forms.LinkLabel lnkSelectAll;
private System.Windows.Forms.LinkLabel lnkFind;
private System.Windows.Forms.LinkLabel lnkClearFormat;
private System.Windows.Forms.LinkLabel lnkMoveToBegin;
private System.Windows.Forms.LinkLabel lnkMoveToEnd;
private System.Windows.Forms.LinkLabel lnkZoomIn;
private System.Windows.Forms.LinkLabel lnkPrint;
private System.Windows.Forms.LinkLabel lnkSave;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public frmOnlyFile()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmOnlyFile));
this.pnlOnlyFile = new System.Windows.Forms.Panel();
this.lnkClearFormat = new System.Windows.Forms.LinkLabel();
this.lnkMoveToBegin = new System.Windows.Forms.LinkLabel();
this.lnkMoveToEnd = new System.Windows.Forms.LinkLabel();
this.lnkZoomIn = new System.Windows.Forms.LinkLabel();
this.lnkPrint = new System.Windows.Forms.LinkLabel();
this.lnkSetBold = new System.Windows.Forms.LinkLabel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnSaveFile = new System.Windows.Forms.Button();
this.txtFile = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.btnDeleteFile = new System.Windows.Forms.Button();
this.btnExportFile = new System.Windows.Forms.Button();
this.btnOpen = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.txtFileDetail = new PublicUIComponent.SuperRichTextBox();
this.lnkItalic = new System.Windows.Forms.LinkLabel();
this.lnkFontSizeUp = new System.Windows.Forms.LinkLabel();
this.lnkFontSizeDown = new System.Windows.Forms.LinkLabel();
this.lnkSelectFont = new System.Windows.Forms.LinkLabel();
this.lnkCut = new System.Windows.Forms.LinkLabel();
this.lnkCopy = new System.Windows.Forms.LinkLabel();
this.lnkPaste = new System.Windows.Forms.LinkLabel();
this.lnkSelectAll = new System.Windows.Forms.LinkLabel();
this.lnkFind = new System.Windows.Forms.LinkLabel();
this.lnkSave = new System.Windows.Forms.LinkLabel();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.pnlOnlyFile.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// pnlOnlyFile
//
this.pnlOnlyFile.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pnlOnlyFile.BackgroundImage")));
this.pnlOnlyFile.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pnlOnlyFile.Controls.Add(this.lnkClearFormat);
this.pnlOnlyFile.Controls.Add(this.lnkMoveToBegin);
this.pnlOnlyFile.Controls.Add(this.lnkMoveToEnd);
this.pnlOnlyFile.Controls.Add(this.lnkZoomIn);
this.pnlOnlyFile.Controls.Add(this.lnkPrint);
this.pnlOnlyFile.Controls.Add(this.lnkSetBold);
this.pnlOnlyFile.Controls.Add(this.groupBox1);
this.pnlOnlyFile.Controls.Add(this.label1);
this.pnlOnlyFile.Controls.Add(this.txtFileDetail);
this.pnlOnlyFile.Controls.Add(this.lnkItalic);
this.pnlOnlyFile.Controls.Add(this.lnkFontSizeUp);
this.pnlOnlyFile.Controls.Add(this.lnkFontSizeDown);
this.pnlOnlyFile.Controls.Add(this.lnkSelectFont);
this.pnlOnlyFile.Controls.Add(this.lnkCut);
this.pnlOnlyFile.Controls.Add(this.lnkCopy);
this.pnlOnlyFile.Controls.Add(this.lnkPaste);
this.pnlOnlyFile.Controls.Add(this.lnkSelectAll);
this.pnlOnlyFile.Controls.Add(this.lnkFind);
this.pnlOnlyFile.Controls.Add(this.lnkSave);
this.pnlOnlyFile.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlOnlyFile.Location = new System.Drawing.Point(0, 0);
this.pnlOnlyFile.Name = "pnlOnlyFile";
this.pnlOnlyFile.Size = new System.Drawing.Size(560, 325);
this.pnlOnlyFile.TabIndex = 0;
//
// lnkClearFormat
//
this.lnkClearFormat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lnkClearFormat.AutoSize = true;
this.lnkClearFormat.BackColor = System.Drawing.Color.Transparent;
this.lnkClearFormat.Location = new System.Drawing.Point(232, 160);
this.lnkClearFormat.Name = "lnkClearFormat";
this.lnkClearFormat.Size = new System.Drawing.Size(54, 17);
this.lnkClearFormat.TabIndex = 7;
this.lnkClearFormat.TabStop = true;
this.lnkClearFormat.Text = "清除格式";
this.lnkClearFormat.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkClearFormat_LinkClicked);
//
// lnkMoveToBegin
//
this.lnkMoveToBegin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lnkMoveToBegin.AutoSize = true;
this.lnkMoveToBegin.BackColor = System.Drawing.Color.Transparent;
this.lnkMoveToBegin.Location = new System.Drawing.Point(296, 160);
this.lnkMoveToBegin.Name = "lnkMoveToBegin";
this.lnkMoveToBegin.Size = new System.Drawing.Size(54, 17);
this.lnkMoveToBegin.TabIndex = 8;
this.lnkMoveToBegin.TabStop = true;
this.lnkMoveToBegin.Text = "移到开头";
this.lnkMoveToBegin.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkMoveToBegin_LinkClicked);
//
// lnkMoveToEnd
//
this.lnkMoveToEnd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lnkMoveToEnd.AutoSize = true;
this.lnkMoveToEnd.BackColor = System.Drawing.Color.Transparent;
this.lnkMoveToEnd.Location = new System.Drawing.Point(360, 160);
this.lnkMoveToEnd.Name = "lnkMoveToEnd";
this.lnkMoveToEnd.Size = new System.Drawing.Size(54, 17);
this.lnkMoveToEnd.TabIndex = 6;
this.lnkMoveToEnd.TabStop = true;
this.lnkMoveToEnd.Text = "移到结尾";
this.lnkMoveToEnd.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkMoveToEnd_LinkClicked);
//
// lnkZoomIn
//
this.lnkZoomIn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lnkZoomIn.AutoSize = true;
this.lnkZoomIn.BackColor = System.Drawing.Color.Transparent;
this.lnkZoomIn.Location = new System.Drawing.Point(424, 160);
this.lnkZoomIn.Name = "lnkZoomIn";
this.lnkZoomIn.Size = new System.Drawing.Size(42, 17);
this.lnkZoomIn.TabIndex = 4;
this.lnkZoomIn.TabStop = true;
this.lnkZoomIn.Text = "放大镜";
this.lnkZoomIn.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkZoomIn_LinkClicked);
//
// lnkPrint
//
this.lnkPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.lnkPrint.AutoSize = true;
this.lnkPrint.BackColor = System.Drawing.Color.Transparent;
this.lnkPrint.Location = new System.Drawing.Point(472, 160);
this.lnkPrint.Name = "lnkPrint";
this.lnkPrint.Size = new System.Drawing.Size(29, 17);
this.lnkPrint.TabIndex = 5;
this.lnkPrint.TabStop = true;
this.lnkPrint.Text = "打印";
this.lnkPrint.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkPrint_LinkClicked);
//
// lnkSetBold
//
this.lnkSetBold.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.lnkSetBold.AutoSize = true;
this.lnkSetBold.BackColor = System.Drawing.Color.Transparent;
this.lnkSetBold.Location = new System.Drawing.Point(280, 8);
this.lnkSetBold.Name = "lnkSetBold";
this.lnkSetBold.Size = new System.Drawing.Size(29, 17);
this.lnkSetBold.TabIndex = 3;
this.lnkSetBold.TabStop = true;
this.lnkSetBold.Text = "粗体";
this.lnkSetBold.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkSetBold_LinkClicked);
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.BackColor = System.Drawing.Color.Transparent;
this.groupBox1.Controls.Add(this.btnSaveFile);
this.groupBox1.Controls.Add(this.txtFile);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.btnDeleteFile);
this.groupBox1.Controls.Add(this.btnExportFile);
this.groupBox1.Controls.Add(this.btnOpen);
this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.groupBox1.Location = new System.Drawing.Point(24, 192);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(520, 120);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "文件管理";
//
// btnSaveFile
//
this.btnSaveFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSaveFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSaveFile.Location = new System.Drawing.Point(224, 72);
this.btnSaveFile.Name = "btnSaveFile";
this.btnSaveFile.Size = new System.Drawing.Size(80, 24);
this.btnSaveFile.TabIndex = 3;
this.btnSaveFile.Text = "保存";
this.btnSaveFile.Click += new System.EventHandler(this.btnSaveFile_Click);
//
// txtFile
//
this.txtFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtFile.BackColor = System.Drawing.Color.White;
this.txtFile.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtFile.Location = new System.Drawing.Point(64, 40);
this.txtFile.Name = "txtFile";
this.txtFile.ReadOnly = true;
this.txtFile.Size = new System.Drawing.Size(392, 21);
this.txtFile.TabIndex = 2;
this.txtFile.Text = "";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(8, 42);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(48, 17);
this.label2.TabIndex = 1;
this.label2.Text = "文件名:";
//
// btnDeleteFile
//
this.btnDeleteFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnDeleteFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDeleteFile.Location = new System.Drawing.Point(320, 72);
this.btnDeleteFile.Name = "btnDeleteFile";
this.btnDeleteFile.Size = new System.Drawing.Size(80, 24);
this.btnDeleteFile.TabIndex = 3;
this.btnDeleteFile.Text = "删除";
this.btnDeleteFile.Click += new System.EventHandler(this.btnDeleteFile_Click);
//
// btnExportFile
//
this.btnExportFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnExportFile.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnExportFile.Location = new System.Drawing.Point(416, 72);
this.btnExportFile.Name = "btnExportFile";
this.btnExportFile.Size = new System.Drawing.Size(80, 24);
this.btnExportFile.TabIndex = 3;
this.btnExportFile.Text = "导出";
this.btnExportFile.Click += new System.EventHandler(this.btnExportFile_Click);
//
// btnOpen
//
this.btnOpen.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnOpen.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpen.Location = new System.Drawing.Point(464, 38);
this.btnOpen.Name = "btnOpen";
this.btnOpen.Size = new System.Drawing.Size(32, 24);
this.btnOpen.TabIndex = 3;
this.btnOpen.Text = "…";
this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -