hi
how to do this:
when i'll press 'G'
on textbox in my form i'll see 'A'
?
in C# code (windows-CE or Windows-mobile)
thank's in advance
hi
how to do this:
when i'll press 'G'
on textbox in my form i'll see 'A'
?
in C# code (windows-CE or Windows-mobile)
thank's in advance
I think you should handle the KeyPress event. Check if the key pressed is G, if yes, reject the input and put A in the textbox. Try this (The character will be appended to existing text:
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == 'G')
{
// Stop the character from being entered into the control
e.Handled = true;
textBox1.Text += 'A';
}
}
TextBox t = new TextBox();
t.KeyPress += new KeyPressEventHandler(t_KeyPress);
void t_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 'G')
e.KeyChar = 'A';
}