Ext: http://www.cnblogs.com/JuneZhang/archive/2011/05/20/2051973.html
There are two main ways to implement this menu:
First: implemented by sending keystrokes to the application.
First focus to the currently active RichTextBox, and then by sending the keystroke command to implement the Operation function
Sendkeys.send ("^a")/Select All |
Sendkeys.send ("^c");/copy |
Sendkeys.send ("^x");//Cut |
Sendkeys.send ("^v");//paste |
The second type: directly manipulate the Clipboard implementation by command
Clipboard.setdata (DATAFORMATS.RTF, RICHTEXTBOX1.SELECTEDRTF)//Copy RTF data to clipboard |
Clipboard.setdata (DATAFORMATS.RTF, RICHTEXTBOX1.SELECTEDRTF)//Copy RTF data to clipboard |
Richtextbox1.selectedrtf= "" "" ", or the current selection of RTF content to clear out, the current implementation of the cut function. |
Richtextbox1.paste ()//paste the data on the Clipboard to the target RichTextBox |
Select All (there are two ways to select all of them) |
Richtextbox1.focus ()//sets the first focus to the current active RichTextBox, which is important, otherwise it will not execute correctly |
The other is through the select (int start,int length) method to implement |
Richtextbox1.select (0, RichTextBox1.Rtf.Length);//richtextbox1.rtf.length represents the length of text in RichTextBox |
One is to directly adopt the SelectAll () method provided in the NET Framework to select all |
Richtextbox1.selectall (); |