Hi,
I have a small problem. After making a hex mask, I can not copy/paste with CTRL C/V. If I right click in the textbox I can paste. But I would like to be able to just press CTRL V.
If I delete the hex mask, CTRL C/V works fine.
Here is a bit of the code:
private void maskedTextBox1(Object sender, System.Windows.Forms.KeyPressEventArgs e)
{
// this will allow a-f, A-F, 0-9, ","
if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "^[0-9a-fA-F,V,C,'\b']+$"))
{
e.Handled = true;
}
// if keychar == 13this ill allow <ENTER>
if (e.KeyChar == (char)13)
{
button1_Click(sender, e);
}
// I thought I could fix it with the lines below but it doesnt work
/* if (e.KeyChar == (char)22)
{
// <CTRL + C>
e.Handled = true;
}
if (e.KeyChar == (char)03)
{
// is <CTRL + V>
e.Handled = true;
}*/
//MessageBox.Show(((int)e.KeyChar).ToString());
}
Could someone give me some hints, Please?