public Form1()
{
InitializeComponent();
} private void 剪切TToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Cut();
} private void 复制CToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Copy();
} private void 粘贴PToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Paste();
} private void 撤消UToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Undo();
} private void 重复RToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Redo();
} private void 全选AToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.SelectAll();
} private void toolStripStatusLabel2_Click(object sender, EventArgs e)
{ } private void 自动换行ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (richTextBox1.WordWrap)
{
自动换行ToolStripMenuItem.Checked = false;
richTextBox1.WordWrap = false;
toolStripStatusLabel4.Text = "";
toolStripStatusLabel6.Text = richTextBox1.TextLength.ToString();
}
else
{
自动换行ToolStripMenuItem.Checked = true;
richTextBox1.WordWrap = true;
}
} private void richTextBox1_TextChanged(object sender, EventArgs e)
{
toolStripStatusLabel2.Text = richTextBox1.TextLength.ToString();//字符数 toolStripStatusLabel4.Text = richTextBox1.Lines.Length.ToString();//行号 toolStripStatusLabel6.Text = (richTextBox1.SelectionStart - richTextBox1.GetFirstCharIndexOfCurrentLine()).ToString();//焦点所在列数
} private void richTextBox1_Click(object sender, EventArgs e)
{
toolStripStatusLabel6.Text = (richTextBox1.SelectionStart - richTextBox1.GetFirstCharIndexOfCurrentLine()).ToString();//焦点所在列数 int index = richTextBox1.GetFirstCharIndexOfCurrentLine();//GetFirstCharIndexOfCurrentLine()当前行第一个字符的索引
//GetLineFromCharIndex(index)指定位置的索引行号
toolStripStatusLabel4.Text = (richTextBox1.GetLineFromCharIndex(index) + ).ToString();//焦点所在行号
}

winform记事本初步实现的更多相关文章

  1. 本周博客--WinForm线程初步 2014-10-31 09:15 54人阅读 评论(0) 收藏

    嗯,WinForm作为一个比较程序的微软的技术已经为我们服务了很久很久,在技术不断更新的今天WinForm虽显老态龙钟但是在客户端快速开发中,它的地位还是无可取代的 今天就来分享一下WinForm中的 ...

  2. winform记事本(基本功能)

    本题主要考察各种控件的应用 using System; using System.Collections.Generic; using System.ComponentModel; using Sys ...

  3. C#+Winform记事本程序

    第17章 记事本 如何使用Visual C# 2010设计一个Windows应用程序——记事本,学习,可以进一步掌握MenuStrip(菜单).ToolStrip(工具栏).RichTextBox(高 ...

  4. winform(记事本的打印)

  5. winform(记事本--查找)

  6. winform(记事本--保存和退出)

  7. winform(记事本--剪切复制等和打开)

  8. winform 记事本 剪切 粘贴 全选 撤销

    private void 撤消UToolStripMenuItem_Click(object sender, EventArgs e) { textBox1.Undo(); } private voi ...

  9. 动态加载与插件系统的初步实现(3):WinForm示例

    动态加载与插件系统的初步实现(三):WinForm示例 代码文件在此Download,本文章围绕前文所述默认AppDomain.插件容器AppDomain两个域及IPlugin.PluginProvi ...

随机推荐

  1. 实现一种快速查找Richedit中可见区域内OLE对象的方法

    Richedit是一个OLE容器,使用Richedit来显示IM聊天内容时,通常使用OLE对象来实现在Richedit中播放表情动画. 触发表情的绘制有两种途径: 1.来自Richedit的刷新消息. ...

  2. leetcode4568

    date: 2015-09-13 16:32:49 Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of ...

  3. Android开发学习笔记:浅谈WebView(转)

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://liangruijun.blog.51cto.com/3061169/647456 ...

  4. java中static作用详解

    static表示“全局”或者“静态”的意思,用来修饰成员变量和成员方法,也可以形成静态static代码块,但是Java语言中没有全局变量的概念. 被static修饰的成员变量和成员方法独立于该类的任何 ...

  5. LR连接oracle时出现:SQLState=28000[Oracle][ODBC][Ora]ORA-01017:invalid username/password;logon denied

    出现的现象:

  6. Loadrunner中参数化实战(6)-Random+Each occurrence

    参数化数据30条: 脚本如下,演示登录,投资,退出操作是,打印手机号: 首先验证Vugen中迭代: Random+Each occurrence 设置迭代4次Action 结果如下:

  7. lr_think_time参数化

    深圳湖北籍软件测试群 275212937

  8. LoadRunner录制图片验证码

    LoadRunner录制图片验证码 LoadRunner自身是无法捕获到图片验证码的,但是我们可以帮助LoadRunner来实现验证码的捕获. 1.图片验证码 图片验证码的产生来自服务器端,由服务器生 ...

  9. 简单记录在Visual Studio 2013中创建ASP.NET Web API 2

    在很多跨平台的应用中就需要Web API ,比如android与数据库的交互. Create a Web API Project 选择新建项目下的模板下的Visual C#节点下的Web节点,在模板列 ...

  10. 判断网络是否连接 和 判断GPS是否连接

    //判断网络是否连接 public static Boolean isNetworkEnabled(Context context){ int status=-1  //设置默认连接的状态为-1 Co ...