Jerry Nixon
Jerry Nixon

Reputation: 31831

In WinRT-XAML; prevent paste into TextBox

I have a TextBox and I don't want the user to Paste into it.

How do I prevent paste?

Also is a drop of text from another app into a TextBox a Paste event?

Upvotes: 3

Views: 217

Answers (1)

N_A
N_A

Reputation: 19897

As of Windows 8.1, the Windows.UI.XAML.TextBox control has a Paste event handler which fires before the content is inserted into the control. If you set the Handled property to true, the text will not be inserted into the TextBox.

Upvotes: 5

Related Questions