Windowsフォームのビジュアルベーシックでプログラムを実行しており、複数のカウンターを作成しようとしています
これが私のコードです:
If txtAnswer.Text = nMathSum Then
nCount = nCount + 1
lblCorrect.Text = nCount
ElseIf txtAnswer.Text <> nMathSum Then
nIount = nIount + 1
lblIncorrect.Text = nIount
End If
If txtAnswer.Text = nMathDiff Then
nCount = nCount + 1
lblCorrect.Text = nCount
ElseIf txtAnswer.Text <> nMathDiff Then
nIcount = nIcount + 1
lblIncorrect.Text = nIout
End If
正解と不正解の回数をカウントするとします
合計のカウンターは正常に機能していますが、差額のカウンターに問題があります。正しい答えを入力すると、間違ったラベルに移動します。