请问各位大侠一个VB问题:
Text1 Text2 中为随机的两个数,在Text3输入Text1与Text2的和,点击command1如果Text3=Text1+Text2 则在Label1中显示“正确”并再Label2中累计正确的次数 反之这显示错误,并在Label3中累计错误的次数?
前面显示“正确”和错误的都做好了,就是不知该怎么去累计正确/错误的次数
急啊!
各位帮帮忙吧!!!

解决方案 »

  1.   

    设一个FORM级的整型变量i,
    formload的时候赋值为0
    每正确一次i=i+1
    Label3.caption=csrt(i)
      

  2.   

    command1_click 中
    static a as integer,b as integer
    ……
    if 正确 then
    a=a+1
    else
    b=b+1
    endif
      

  3.   

    form级是啥意思啊?
    If label1.caption = "正确" Then
    label2.caption=csrt(i)
    Else Label3.caption= ??
    然后该怎么写啊!
      

  4.   

    窗体上1个Command1,3个Label,3个Text。建议楼主多看些基础的。Dim n1&, n2&
    Private Sub Command1_Click()
    If Val(Trim(Form1.Text3.Text)) = Val(Trim(Form1.Text1.Text)) + Val(Trim(Form1.Text2.Text)) Then
        Form1.Label1.Caption = "正确"
        n1 = n1 + 1
        Form1.Label2.Caption = "正确:" & n1 & "次数"
    Else
        Form1.Label1.Caption = "错误"
        n2 = n2 + 1
        Form1.Label3.Caption = "错误:" & n2 & "次数"
    End If
    Form1.Text3.Text = ""
    Call Form1.Form_Load
    End SubPublic Sub Form_Load()
    Randomize
    Form1.Text1.Text = Int(Rnd * 10)
    Form1.Text2.Text = Int(Rnd * 10)
    End Sub