Vb.net 将文本框输出移动到其他文本框中
我试图输出文本到另一个文本框,一旦第一个有5个条目。例子;我给的分数是100200300200200。现在,当我尝试输入一个新的分数时,它应该将它放在下一个文本框中,但是没有发送Vb.net 将文本框输出移动到其他文本框中,vb.net,Vb.net,我试图输出文本到另一个文本框,一旦第一个有5个条目。例子;我给的分数是100200300200200。现在,当我尝试输入一个新的分数时,它应该将它放在下一个文本框中,但是没有发送 Dim Testint As Integer ' define an Integer for testing Dim sampleTextBox(3) As TextBox sampleTextBox(0) = txtPlayer1Scores sampleTextBox(1) = txtPla
Dim Testint As Integer ' define an Integer for testing
Dim sampleTextBox(3) As TextBox
sampleTextBox(0) = txtPlayer1Scores
sampleTextBox(1) = txtPlayer2Scores
sampleTextBox(2) = txtPlayer3Scores
sampleTextBox(3) = txtPlayer4Scores
Dim sampleLabel(3) As Label
sampleLabel(0) = lblPlayer1Average
sampleLabel(1) = lblPlayer2Average
sampleLabel(2) = lblPlayer3Average
sampleLabel(3) = lblPlayer4Average
scoreArray(textCount, gameNumber - 1) = CInt(txtScoreInput.Text) ' subtracting 1 from the score array
sampleTextBox(textCount).Text &= " Score:" & scoreArray(textCount, gameNumber - 1) & vbCrLf
'output statement
gameNumber = gameNumber + 1 'increment the counter
If gameNumber > MAX_SCORE_LENGTH Then
sampleTextBox(textCount).Focus()
sampleTextBox(textCount).Enabled = False
For i As Integer = 0 To 4 'Add the array values up
scoreTotal += scoreArray(textCount, i)
Next
playerAverage = scoreTotal / MAX_SCORE_LENGTH
sampleLabel(labelCount).Text = playerAverage
' I need the textbox switch here
textCount = textCount + 1
labelCount = labelCount + 1 ' and labels
ElseIf textCount > MAX_PLAYERS Then
'calculate team average
btnEnterScore.Enabled = False
Else
lblEnterScore.Text = "Enter Score for game #" & gameNumber ' 5 scores have not be inputted,
txtScoreInput.Text = "" 'ask for more
txtScoreInput.Focus() 'refocus the input textbox
End If
修正了…将“最大长度”设置为15会迫使它在15位之后继续移动,当长度小于15位时,它也会起作用
txtscore1.MaxLength = 15
欢迎来到堆栈溢出。你能编辑你的问题使你的问题更清楚吗?对不起,我现在就这么做。那么,你是说,当用户试图在
文本框中键入第五个逗号时,焦点将自动转移到另一个文本框中?第五个分数将进入第一个文本框,然后,他们输入的下一个分数进入第二个文本框,并将继续,直到所有4个多行框各有5个分数