VB 进入FORM2后怎么自动关闭FORM1?
来源:百度知道 编辑:UC知道 时间:2024/06/02 14:06:56
我想要程序FORM1进入FORM2的时候,自动关闭自身。
而且FORM2后退到FORM1的时候自动关闭自身。
那下列程序应该加在哪里呢 ?我要隐藏程序~~~~`
Private Sub Command1_Click()
If Text1 = "123456" Then
MsgBox "密码正确,允许登录"
Load Form2
Form2.Show
Else
Text1 = ""
PassNum = PassNum + 1
MsgBox "警告:密码错误"
Text1.SetFocus
End If
End Sub
Private Sub Form_Load()
PassNum = 0
Text1 = ""
Text1.PasswordChar = "*"
Text1.MaxLength = 6
Command1.Caption = "登录"
Command1.Default = True
Me.Show
Text1.SetFocus
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Year(Date) & "年" & Month(Date) & "月" & Day(Date) & "日 " & Time & " 星期" & Weekday(Now) - 1
End Sub
而且FORM2后退到FORM1的时候自动关闭自身。
那下列程序应该加在哪里呢 ?我要隐藏程序~~~~`
Private Sub Command1_Click()
If Text1 = "123456" Then
MsgBox "密码正确,允许登录"
Load Form2
Form2.Show
Else
Text1 = ""
PassNum = PassNum + 1
MsgBox "警告:密码错误"
Text1.SetFocus
End If
End Sub
Private Sub Form_Load()
PassNum = 0
Text1 = ""
Text1.PasswordChar = "*"
Text1.MaxLength = 6
Command1.Caption = "登录"
Command1.Default = True
Me.Show
Text1.SetFocus
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Year(Date) & "年" & Month(Date) & "月" & Day(Date) & "日 " & Time & " 星期" & Weekday(Now) - 1
End Sub
unload form1 '卸载form1,从内存中卸载掉
forma.hide '隐藏form1,只是该窗体不见,但还在内存中
我在你上个提问中已经告诉你了 ..
哎.. 不认真看回答
在Form1中只需对Private Sub Command1_Click()作如下修改
Private Sub Command1_Click()
If Text1 = "123456" Then
MsgBox "密码正确,允许登录"
Load Form2
Form2.Show
Form1.Hide '这是加的一句
Else
Text1 = ""
PassNum = PassNum + 1
MsgBox "警告:密码错误"
Text1.SetFocus
End If
End Sub
以下是Form2中的代码
Private Sub Form_Unload(Cancel As Integer)
Form1.Show
End Sub
VB中程序运行后跳出FORM1,怎么添加定时器使自动过三秒就跳出FORM2?
VB form2.Show(格式)
vb时间事件- 比如我想在80分钟后弹出form2
c# FORM1怎么连接FORM2?
开机后自动进入一个网站,怎么清除,拜托
Winxp到登陆画面进入后自动注销怎么解决
程序进入计算机后是怎么自动工作的
木马进入计算机后是怎么自动工作的
我用vb.net,不想换成别的了。跨窗体操作怎么写代码?如在form2中,实现form1.label1.text="****",怎么写
在Delphi 7中,我想做一个登录画面,正常登录后,则进入到操作画面,其分别为form1与form2请问要如何实现