receive keyboard events by two components simultaneously
Hi.
I want when I press a key on keyboard,
two components can get this event simultaneously.
How can I do that?
For example I have two textbox. One of them is
read only and the focus is on this textbox. I want
that when I write something, second textbox can
receive my text.
thanks friends
Niradhip ChakrabortyPosted Jul 13, 2009, 4:42 PM
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (textBox1.Text != "")
{
textBox2.Text = textBox1.Text;
}
else
{
textBox2.Text = "";
}
}
private void textBox1_Leave(object sender, EventArgs e)
{
if (textBox1.Text != "")
{
textBox2.Text = textBox1.Text;
}
else
{
textBox2.Text = "";
}
}
omidPosted Jul 10, 2009, 9:56 AM
Niradhip ChakrabortyPosted Jul 10, 2009, 9:23 AM