(X) Hide this Join our next live webcast on December 15th, 10 am PDT - Building a Silverlight 4 application end-to-end. Presenter: Gill Cleeren
Check the webinar agenda | Register for the webinar
Skip Navigation LinksHome / News / View News

Quick Tip: Change text on the Clipboard before you paste CTRL + V

+ Add to SilverlightShow Favorites
0 comments   /   posted by Silverlight Show on Nov 19, 2010
(0 votes)

SilverlightShow Page for all Silverlight and Windows Phone 7 (WP7) things on TwitterThis quick tip describes how the text from the Clipboard can be modified before the user inserts the text with CTRL + V in a TextBox.

Source: SilverLaw

KeyDown event of a TextBox checks whether the user has pressed the key combination CTRL + V. If this is the case, the text from the Clipboard using the method assigns Clipboard.GetText() of a private variable. It follows a check whether the text in the Clipboard is an empty string. If not, is a modification of the text from the Clipboard intercepted. A substring is formed in the example above. Finally, the modified text using the method assigns SetText() of Clipboard.

When the user releases the key combination, the text on the Clipboard is now from the modified text and insert this text.  

Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 2 and 7 and type the answer here: