0

に問題がありますbtnNext

私はbtnNextそれを9回目のクリックで制限したいと思っています。

9 回クリックすると、ボタンが無効になります。どうすればいいのですか?

Private Sub Button3_Click(ByVal sender As System.Object,
                          ByVal e As System.EventArgs) Handles btnnext.Click
  If btnnext.Text = "Submit" Then
    calculate()
    btnnext.Text = "Next>"
  ElseIf btnnext.Text = "Next>" Then
    CurrentRow += 5
    cat += 5
    showdata()
    updatelbl()
    clear_radio()
    ' calculate_case(1)
    ' calculate_case(2)
    ' calculate_case(3)
    ' calculate_case(4)
    btnnext.Text = "Submit"
    If CurrentRow & cat = ds.Tables("evaluation").Rows.Count >= 20 Then
      MsgBox("Last Questions is Reached!!!")
    End If
    If btnnext.Text = "Management of Learning" Then
      btnnext.Text = "Finish"
      If btnnext.Text = "Finish" Then
        CurrentRow = 35
        cat = 35
        MsgBox("Comment")
      End If
    End If
  End If
End Sub
4

2 に答える 2

3

このような

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Static ctClicks As Integer = 0
    ctClicks += 1
    If ctClicks = 9 Then Button1.Enabled = False
    'other code
    '
End Sub
于 2013-09-19T16:19:18.423 に答える
3
 Private btnCount As Integer
 Private Sub Button3_Click(...)...
  btnCount += 1
  If btnCount = 9 Then Button3.Enabled = False
  'remainder of code here...
于 2013-09-19T16:18:18.100 に答える