- 设计窗体,控件安排如图31:
图31
- 代码如下:
Sub Form1_Command1_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)
Static n As Integer
If Text1.Text = "abc" And Text2.Text = "123" Then
MsgBox("欢迎光临!")
Else
n = n + 1
If n = 3 Then
MsgBox("您无权登录!")
Command1.Enabled=False
Else
MsgBox("用户名或密码错误!")
End If
End If
End Sub
Sub Form1_Command2_BN_Clicked(hWndForm As hWnd, hWndControl As hWnd)
End
End Sub