Private Sub Command1_Click()
Static n As Long, m As Long
m = Val(Text2)
n = n + 1
If Text1 = "psw123" Then
MsgBox "口令正确", vbExclamation, "登录"
n = 0
Else
If n >= m Then
MsgBox n & "次输入错误,请退出", vbExclamation, "登录"
End
Else
MsgBox "第" & n & "次口令输入错误,请重新输入", vbExclamation, "登录"
Text1SetFocus
End If
End If
End Sub
Private Sub Form_Load()
Label1Caption = "口令:"
Label2Caption = "允许输入口令的次数:"
Command1Caption = "确定"
MeCaption = "登录"
Text1 = ""
Text1PasswordChar = ""
Text2 = 3
End Sub
Dim a As Single, b As Single, c As Single, d As Single, e As Single
Private Sub Command1_Click()
a = Val(Text1Text)
b = Val(Text2Text)
c = Val(Text3Text)
d = a b c
Text4Text = d
End Sub
Private Sub Command2_Click()
If d > 0 Then
e = e + d
End If
Text5Text = e
End Sub
Private Sub Command3_Click()
Text1Text = ""
Text2Text = ""
Text3Text = ""
Text4Text = ""
End Sub
以上就是关于VB程序设计全部的内容,包括:VB程序设计、设计VB程序、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)