U
Uchiha Jax
I have created a custom textbox which contains an arraylist of permitted
chars.
Any chars that are not in the list are not permitted.
One of the events looks like this and is attached to either this.KeyUp or
this.KeyDown:
private void TextBoxEx_KeyAction(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
EnterPressed(this, e);
}
if(!_allowAll)
{
if(al.IndexOf(e.KeyCode)== -1)
{
e.Handled = true;
}
}
}
As you can see I if the keycode does not exist in the ArrayList named al
e.Handled = true, I check with the debugger and sure enough it DOES run this
line but the char still goes through to the textbox?!?
Does anyone know of any conditions where e.Handled = true; will NOT handle
the event as I am very confused by all of this.....
Kind Regards
Jax
chars.
Any chars that are not in the list are not permitted.
One of the events looks like this and is attached to either this.KeyUp or
this.KeyDown:
private void TextBoxEx_KeyAction(object sender, KeyEventArgs e)
{
if(e.KeyCode == Keys.Enter)
{
EnterPressed(this, e);
}
if(!_allowAll)
{
if(al.IndexOf(e.KeyCode)== -1)
{
e.Handled = true;
}
}
}
As you can see I if the keycode does not exist in the ArrayList named al
e.Handled = true, I check with the debugger and sure enough it DOES run this
line but the char still goes through to the textbox?!?
Does anyone know of any conditions where e.Handled = true; will NOT handle
the event as I am very confused by all of this.....
Kind Regards
Jax