B
Beebs
How come when calling the following code from a button, even with the
cursor in txtFraction, it never evaluates to True? This function, no
matter where the cursor is always says txtNumber has the focus. Can
anyone see what I'm doing wrong?
Private Sub Button_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim btn As Button = CType(sender, Button)
If txtNumber.Focus = True Then
If btn.Text = "Fraction" Then
txtFraction.Focus()
Else
txtNumber.Text = txtNumber.Text & btn.Text
End If
ElseIf txtFraction.Focus = True Then
If btn.Text = "Fraction" Then
txtNumber.Focus()
Else
txtFraction.Text = txtFraction.Text & btn.Text
End If
End If
End Sub
cursor in txtFraction, it never evaluates to True? This function, no
matter where the cursor is always says txtNumber has the focus. Can
anyone see what I'm doing wrong?
Private Sub Button_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim btn As Button = CType(sender, Button)
If txtNumber.Focus = True Then
If btn.Text = "Fraction" Then
txtFraction.Focus()
Else
txtNumber.Text = txtNumber.Text & btn.Text
End If
ElseIf txtFraction.Focus = True Then
If btn.Text = "Fraction" Then
txtNumber.Focus()
Else
txtFraction.Text = txtFraction.Text & btn.Text
End If
End If
End Sub