I didnt find an event that I can verify each char that I'm pasting. And I need verify using ASCII code 'cause I want to handle ' and "
KeyPress Event:
private void txt_KeyPress(object sender, KeyPressEventArgs e)
{
if( e.KeyChar == 34 || e.KeyChar == 39)//34 = " 39 = '
{
e.Handled = true;
}
}
Simple Solution:
private void txt_TextChanged(object sender, EventArgs e)
{
string text = txt.Text;
while (text.Contains("\"") || text.Contains("'")) text = text.Replace("\"", "").Replace("'", "");
txt.Text = text;
}