vb问题请教,从一个窗体转化到另一个不能实现!?谢谢~~
PrivateSubForm_Load()Text1.Text=""Text1.MaxLength=5Text2.Text=""Text2.MaxLength=4Text...
Private Sub Form_Load()
Text1.Text = ""
Text1.MaxLength = 5
Text2.Text = ""
Text2.MaxLength = 4
Text2.PasswordChar = "*"
End Sub
Private Sub Text1_LostFocus()
If Not IsNumeric(Text1.Text) Then
MsgBox "用户名必须为数字", "", "警告"
Text1.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub Command1_Click()
Dim m As Integer
If Text2.Text <> "abcd" Then
m = MsgBox("密码错误", 5 + 48, "警告")
If m <> 4 Then
End
Else
Text2.Text = ""
Text2.SetFocus
Form1.Hide
Form2.Show
End If
End If
End Sub
If Not IsNumeric(Text1.Text) Then "用户名必须为数字"改为"用户名必须为字母"或其他的怎么改呢?
Form1.Hide
Form2.Show
它按了commond 后form1不能转换到form2 展开
Text1.Text = ""
Text1.MaxLength = 5
Text2.Text = ""
Text2.MaxLength = 4
Text2.PasswordChar = "*"
End Sub
Private Sub Text1_LostFocus()
If Not IsNumeric(Text1.Text) Then
MsgBox "用户名必须为数字", "", "警告"
Text1.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub Command1_Click()
Dim m As Integer
If Text2.Text <> "abcd" Then
m = MsgBox("密码错误", 5 + 48, "警告")
If m <> 4 Then
End
Else
Text2.Text = ""
Text2.SetFocus
Form1.Hide
Form2.Show
End If
End If
End Sub
If Not IsNumeric(Text1.Text) Then "用户名必须为数字"改为"用户名必须为字母"或其他的怎么改呢?
Form1.Hide
Form2.Show
它按了commond 后form1不能转换到form2 展开
2个回答
展开全部
Private Sub Text1_LostFocus()
If Not IsNumeric(Text1.Text) Then
MsgBox "用户名必须为数字", vbOKOnly, "警告"
Text1.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub Command1_Click()
If Text2.Text <> "abcd" Then
MsgBox "密码错误", vbOKOnly, "警告"
Text2.Text = ""
Exit Sub
Else
Text2.Text = ""
Unload Me
Form2.Show
End If
End Sub
Private Sub Command2_Click()
If IsNumeric(Text1.Text) Then
MsgBox "用户名必须为字母", vbOKOnly, "警告"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
End Sub
If Not IsNumeric(Text1.Text) Then
MsgBox "用户名必须为数字", vbOKOnly, "警告"
Text1.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub Command1_Click()
If Text2.Text <> "abcd" Then
MsgBox "密码错误", vbOKOnly, "警告"
Text2.Text = ""
Exit Sub
Else
Text2.Text = ""
Unload Me
Form2.Show
End If
End Sub
Private Sub Command2_Click()
If IsNumeric(Text1.Text) Then
MsgBox "用户名必须为字母", vbOKOnly, "警告"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询