Hi Guys,
just wondered if anyone knows how to change the focus from 1 textbox to another?
i have 2 textboxes and a few buttons, what i am trying to do is select a textbox (either) then hit the button and the value from the button (i.e 1) will go into the selected/focused textbox.
i can get this to go to the first textbox, but cant figure out how to change the focus, i have trawled the internet but cant find exactlly what im looking for, my code has changed nurmous times, so il just paste what i have got now,
thanks guys
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Focus()
'''TextBox1.Focus()
'''If TextBox1.Focused Then
''' TextBox1.Text = num1
'''ElseIf TextBox2.Focused Then
''' TextBox2.Text = num1
'''End If
If TextBox1.Focused Then
TextBox1.Text = TextBox1.Text & num1
End If
If TextBox2.Focused Then
TextBox2.Text = TextBox2.Text & num1
End If
End Sub