简体   繁体   English

禁用复制和粘贴在wp8中的TextBox中

[英]disable copy and paste in TextBox in wp8

i am developing a windows phone 8 application using c# and i am trying to disable copy and paste in TextBox. 我正在使用C#开发Windows Phone 8应用程序,并且试图禁用在TextBox中的复制和粘贴。 any one can help . 任何人都可以提供帮助。

I have tried: 我试过了:

private void digitBox_KeyDown(object sender, KeyEventArgs e)
{ 
   if (e.Key == (Key.Ctrl | Key.V) ) 
   { 
       e.Handled = true; 
       digitBox.SelectionLength = 0; 
    } 
} 

thanx 谢谢

private void textBox1_KeyDown(object sender, KeyEventArgs e)
  {
   if (e.Modifiers == Keys.Control)
   {
     e.Handled = true;
    textBox1.SelectionLength = 0;
   }
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM