M
Manu Singhal
Hi
I am trying to build a windows forms control which derieves from TextBox.
The added functionality that i want is that
I want every character that appears on the TextBox should be in Capitals.
For this i have created a Class iTextBox and Derieved from TextBox and have
overriden the OnKeyPress Method Here is the code :-
protected override void OnKeyPress(KeyPressEventArgs e)
{
if(Char.IsLetter(e.KeyChar))
{
e = new KeyPressEventArgs(Char.ToUpper(e.KeyChar));
}
base.OnKeyPress (e);
}
But when i test the class it the method runs but the characted is not
converted to Upper case.
Please help and advice.
Manu Singhal
I am trying to build a windows forms control which derieves from TextBox.
The added functionality that i want is that
I want every character that appears on the TextBox should be in Capitals.
For this i have created a Class iTextBox and Derieved from TextBox and have
overriden the OnKeyPress Method Here is the code :-
protected override void OnKeyPress(KeyPressEventArgs e)
{
if(Char.IsLetter(e.KeyChar))
{
e = new KeyPressEventArgs(Char.ToUpper(e.KeyChar));
}
base.OnKeyPress (e);
}
But when i test the class it the method runs but the characted is not
converted to Upper case.
Please help and advice.
Manu Singhal