C#RichTextBox实现(复制, 剪切,粘贴,全选)
|
admin
2021年1月20日 10:50
本文热度 3074
|
实现该菜单功能主要有两种方法:
第一种:通过发送击键到应用程序来实现。
先焦点定位到当前活动的RichTextBox,然后再通过发送击键命令来实现操作功能
第二种:直接通过命令操作剪贴板实现
Clipboard.SetData(DataFormats.Rtf, richTextBox1.SelectedRtf); |
Clipboard.SetData(DataFormats.Rtf, richTextBox1.SelectedRtf); |
richTextBox1.SelectedRtf= "" ; |
richTextBox1.Select(0, richTextBox1.Rtf.Length); |
该文章在 2021/1/20 10:50:18 编辑过