using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace xiezhiban
{
public partial class Form1 : Form
{
string s;
public Form1()
{
InitializeComponent();
}
private void 复制ToolStripMenuItem_Click(object sender, EventArgs e)
{
s = this.richTextBox1.SelectedText;
}
private void 剪切ToolStripMenuItem_Click(object sender, EventArgs e)
{
s = this.richTextBox1.SelectedText;
this.richTextBox1.SelectedText = "";
}
private void 粘贴ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.richTextBox1.SelectedText += s;
}
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog ofd =new OpenFileDialog();
ofd.Filter = "text|*.Txt|rtf|*.rtf";
ofd.Multiselect = false;
ofd.ShowDialog();
string fn = ofd.FileName;
if (fn != "")
{
this.richTextBox1.LoadFile(fn,RichTextBoxStreamType.PlainText);
}
}
private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog sfd =new SaveFileDialog();
sfd.Filter = "text|*.Txt|rtf|*.rtf";
sfd.ShowDialog();
string fn = sfd.FileName;
if (fn != "")
{
this.richTextBox1.SaveFile(fn,RichTextBoxStreamType.PlainText);
}
}
private void 字体ToolStripMenuItem_Click(object sender, EventArgs e)
{
FontDialog zt = new FontDialog();
zt.Font=richTextBox1.SelectionFont;
if (zt.ShowDialog() == DialogResult.OK)
richTextBox1.SelectionFont = zt.Font;
}
private void 颜色ToolStripMenuItem_Click(object sender, EventArgs e)
{
ColorDialog afo = new ColorDialog();
afo.Color= richTextBox1.SelectionColor;
if (afo.ShowDialog() == DialogResult.OK)
richTextBox1.SelectionColor = afo.Color;
}
private void 删除ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.richTextBox1.SelectedText = "";
}
private void 时间日期ToolStripMenuItem_Click(object sender, EventArgs e)
{
this.richTextBox1.SelectedText += DateTime.Now.ToString();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
this.label1.Text = DateTime.Now.ToString();
}
}
}
分享到:
相关推荐
c#整理 计算器-记事本-通讯录源码 c#整理 c#计算器- c#记事本 c#-通讯录 c#源码
适合初学者,可以随时随地保存标签 简易 记事本 简易记事本 适合初学者
c#-简易写字板记事本-课程设计-实验 vs 2010下的项目文件夹,打开即可用,代码有注释,有小bug 界面是张国荣哥哥作主题的,欢迎荣迷下载
C#简易写字板记事本-课程设计-实验 vs2010下的项目文件夹,打开即可用,有exe程序在debug文件夹下可以运行看效果,代码有注释,有小bug 界面是张国荣哥哥作主题的,欢迎荣迷下载
使用C#语言winform 窗体 简易的记事本项目,包括下拉菜单,快捷键的运用,保存,另存为,等等一些基本的记事本功能
功能: ① 打开功能: 初始界面打开文件;已修改文件时打开文件(改进点); ② 保存功能: 初始界面键入保存;已修改文件时保存; ③ 关闭检查: 界面关闭按钮时,检查是否已修改并处理;...可以让程序代码显得更加...
一款功能完备的记事本程序,开发环境Visual C#
简易记事本 简易记事本 简易记事本 简易记事本 简易记事本 简易记事本
android记事本--geolo版 android入门学习
简易记事本简易记事本简易记事本简易记事本简易记事本简易记事本简易记事本简易记事本简易记事本简易记事本
记事本--风雨无阻v1.2 超功能记事本 以后继续更新 欢迎下载使用 有更好的意见请发邮箱到fengyuvswuzu@163.com
VB记事本-by:cccVB记事本-by:cccVB记事本-by:ccc
C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本C#记事本
notepad记事本超好用替代原带简单记事本--开发人员一定用得到 notepad记事本超好用替代原带简单记事本--开发人员一定用得到 注册文件已经内含在内,可实现添加到右键,先用记事本打开,修改您具体的安装目录,即可...
C#简易记事本**使用用户控件、线程、委托及 Win32 Api 调用。** **该项目由本人学习 C# 过程中自主开发,仍存在缺陷,
记事本 窗体设计 C# 课程设计 能实现和系统记事本相同的编辑同能。
C#记事本 简单明了 适合初学者 可以和windows记事本媲美哦
C#记事本项目-C#实践
可置顶的记事本-超级好用!
vista记事本 - 站长编程的好助手 vista记事本 - 站长编程的好助手