title: How to set the textbox click event so I can enter numbers to the textbox from an onscreen keyboard?
body: <p>In Visual Basic 2010. I have two textbox and an onscreen number keyboard. Every time I click a number, the number is shown in both the textboxes. How do I make it so I need to click into the textbox first then the number is only entered into that textbox?? This is what I have in my code and it is not working. The numbers I tried to enter to the mtbNum textbox and txtQuantity1 is only shown mtbNum textbox no matter which textbox I clicked on. My professor said to change the click event of the textboxes to textbox_click. However I don't know where to go from there. Can someone please help me? How do I change it so that the textbox has to be clicked for the number to be entered? Please and thank you.</p>
  
  <pre><code>Private Sub btn5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn5.Click
      If mtbNum.Focus = True Then
          mtbNum.Text += "5"
      ElseIf txtQuantity1.Focus = True Then
          txtQuantity1.Text += "5"
      Else
  
      End If
  End Sub
  
  Private Sub mtbNum_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mtbNum.Click
  
  End Sub
  
  Private Sub txtQuantity1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtQuantity1.Click
  
  End Sub
  </code></pre>