Try the following code please.
Private Sub btn5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn5.Click
if mtbNum.Focused = True Then
mtbNum.Text += "5"
Exit Sub()
ElseIf txtQuantity1.Focused = True Then
txtQuantity1.Text += "5"
Exit Sub()
Else
Exit Sub()
End If
End Sub
This is my last try unless you post more code.