WPF Restrict copying text in a textbox
By [)ia6l0 iii
Use the DataObject's Copying handler to avoid copying text from a textbox
XAML:
<TextBox x:Name="CopyRestrictedTextBox" DataObject.Copying="CopyRestrictedTextBox_Copying" />
CODE:
private void CopyRestrictedTextBox_Copying(object sender, DataObjectCopyingEventArgs
e)
{
e.CancelCommand();
}
Related FAQs
The following code sample shows you how.
The Line object derives from the Shape class and is defined by the X and Y attributes (X1, Y1, X2, and Y2)
Use the CombinedGeometry class to merge two shapes in WPF
Static resources refer to the resources that are available in the resources collection of the object.
For e.g.
You can format the strings in binding expressions that are used to bind data.
WPF Restrict copying text in a textbox (1185 Views)