I have 2 textboxes and one button and I don't know why my code doesn't work.
All I'm trying to do is write a number 1 into the textbox with the focus. so
if the user puts the cursor in textBox1 and pushes the button the 1 should go
into that box. If the cursor is in the other one the 1 should go there. It
seems simple but doesn't work. Can anyone give me any hints? Here is the code:
private void button1_Click(object sender, System.EventArgs e)
{
if (textBox1.Focused == true)
textBox1.Text = "1";
if (textBox2.Focused == true)
textBox2.Text = "1";
}