I'm trying to take input keypress event and move the text it would have typed into a textbox to a different textbox instead.
textBox1 has a length limit of 1 so I dont actually have to prevent text going into the box because the textbox is already full
I just need to put the character that would have been typed into the next textbox
Lines 16 and 24 are the problem afaik
'*******************************************************
'Handle all typeable characters in populated(full) boxes
'*******************************************************
If (e.KeyCode > 31 And e.KeyCode < 127) Then
'Only handle full textboxes (empty are already handled)
If Not txtBox.Text = "" Then
For Each o As Object In Me.Controls 'determine which textbox is to the left
If TypeOf o Is TextBox Then
If Val(txtBox.Name.Substring(11, 2)) > 8 Then 'if it's bigger than 8 then +1 will be a 2 digit number (10+)
If o.name.contains("inputTxtBox" + Val(txtBox.Name.Substring(11, 2) + 1).ToString) Then 'Select the txtBox to the right
If o.text = "" Then 'only if the txtbox to the right is empty
o.focus() 'focus it
o.text = e.KeyValue.ToString '//THE PROBLEM
End If
End If
ElseIf Val(txtBox.Name.Substring(11, 2)) <= 8 Then 'if it is 8 or less we need to add the 0 to the string because +1 will be 9 or less
If o.name.contains("inputTxtBox0" + Val(txtBox.Name.Substring(11, 2) + 1).ToString) Then 'Select the txtBox to the right
If o.text = "" And o.enabled = True Then 'only if the txtbox to the right is empty and enabled
o.focus() 'focus it
o.text = e.KeyValue.ToString '//THE PROBLEM
End If
End If
End If
End If
Next
with e.keydata letters work (sort of) but numbers are things like d1 d2 etc
I just need to address the real character. The rest of the code works fine it's just I dont know how to tell it to put in the number "1" instead of "d1" etc