Use the RichTextBox Control to implement the system clipboard function:
Copy:
Private void copytoolstripmenuitem_click (Object sender, eventargs e) <br/>{// copy <br/> try <br/>{< br/> This. cursor = cursors. waitcursor; <br/> string strtemp = richtextboxsendinfo. selectedtext; <br/> // obtain the selected text in RichTextBox <br/> If (strtemp. equals ("") // determines whether it is null <br/> return; <br/> clipboard. clear (); // clear the content in the original clipboard <br/> clipboard. settext (strtemp); // Add text to the clipboard and object type data <br/> This. cursor = cursors. default; <br/>}< br/> catch (system. exception ex) <br/>{< br/> This. cursor = cursors. default; <br/> commonfunc. displayexception (Ex); <br/>}< br/>}
Paste:
Private void pastetoolstripmenuitem_click (Object sender, eventargs e) <br/>{// paste <br/> try <br/>{< br/> This. cursor = cursors. waitcursor; <br/> This. richtextboxsendinfo. paste (); // paste <br/> This. cursor = cursors. default; <br/>}< br/> catch (system. exception ex) <br/>{< br/> This. cursor = cursors. default; <br/> commonfunc. displayexception (Ex); <br/>}</P> <p>}
Cut:
Private void cuttoolstripmenuitem_click (Object sender, eventargs e) <br/>{// cut <br/> try <br/>{< br/> This. cursor = cursors. waitcursor; <br/> string strtemp = richtextboxsendinfo. selectedtext; <br/> If (strtemp. equals ("") <br/> return; <br/> clipboard. clear (); <br/> richtextboxsendinfo. cut (); <br/> This. cursor = cursors. default; <br/>}< br/> catch (system. exception ex) <br/>{< br/> This. cursor = cursors. default; <br/> commonfunc. displayexception (Ex); <br/>}</P> <p>}
Undo:
Private void redotoolstripmenuitem_click (Object sender, eventargs e) <br/>{// undo <br/> try <br/>{< br/> This. cursor = cursors. waitcursor; <br/> richtextboxsendinfo. undo (); <br/> This. cursor = cursors. default; <br/>}< br/> catch (system. exception ex) <br/>{< br/> This. cursor = cursors. default; <br/> commonfunc. displayexception (Ex); <br/>}</P> <p>}