1
I’m using a MaskedTextBox
containing a mask of CNPJ (00.000.000/0000-00
).
But I wish that when I copied this string it would come to the clipboard without the mask, to remove the mask I’m doing this:
maskedTextBox1.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
//área de transferência = maskedTextBox1.Text; (???)
However I do not know which event and to whom I should assign the value without formatting, so copy (CTRL + C) the no mask string for the clipboard.
You can manipulate with the
KeyDown
over the control ofMaskedTextBox
.– CypherPotato
@Cypherpotato hmm true, but to whom I will assign the value without mask?
– Patrick Perdigão
System.Windows.Forms.Clipboard.SetText(maskedTextBox1.Text)
:)– CypherPotato