我正在使用c#开发一个Windows Phone 8应用程序,我试图在TextBox中禁用复制和粘贴。 任何人都可以提供帮助。
我试过了:
private void digitBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == (Key.Ctrl | Key.V) )
{
e.Handled = true;
digitBox.SelectionLength = 0;
}
}
thanx
答案 0 :(得分:2)
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Modifiers == Keys.Control)
{
e.Handled = true;
textBox1.SelectionLength = 0;
}
}