第4章 详细设计
4.1 登录界面设计
如图4-1。
图4-1 登录界面
登录控件编码:
Private Sub cmdOK_Click()
If txtUserName.Text = "" Then
MsgBox "请填写用户名!", vbOKOnly + vbInformation, "注意" txtUserName.SetFocus Exit Sub
ElseIf txtPassword.Text = "" Then
MsgBox "请填写密码!", vbOKOnly + vbInformation, "注意" txtPassword.SetFocus Exit Sub End If
g_bLogin = True
If IsExistUser(txtUserName, txtPassword) = True Then Unload Login frmSearch.Show Else
If IsExistUser(txtUserName, "") = True Then
MsgBox "密码不正确!请重试 ", vbOKOnly + vbInformation, "错误" Else
MsgBox "无此用户!请先注册 ", vbOKOnly + vbInformation, "错误" cmdRegister.SetFocus End If End If