vb中我设定在form1一按钮Command1打开form2打开时打开了~~但form1还开着~怎么让form1自动关闭啊?
说详细点~在哪里加?我的form1文件是PrivateSubCommand1_Click()Form2.ShowEndSubPrivateSubForm_Load()Di...
说详细点~在哪里加?
我的form1文件是
Private Sub Command1_Click()
Form2.Show
End Sub
Private Sub Form_Load()
Dim a As String
a = InputBox("请输入账号")
Dim username(0 To 3) As String
username(0) = "wangzhiyao"
username(2) = "wanglongxiang"
username(1) = "dujiao"
username(3) = "liangjun"
Dim flag As Boolean
flag = False
Dim i As Integer
For i = 0 To 3
If a = username(i) Then
flag = True
End If
Next i
If flag = False Then
MsgBox "账号输入错误,( ^_^ )/~~拜拜"
End
End If
End Sub
Private Sub Picture1_Paint()
Picture1.Print "欢迎来到未知世界作用领域"
End Sub
form2文件是
Private Sub Command1_Click()
Dim a, b, c, d As String
a = Text1.Text
b = Text2.Text
c = (a + b) * 2
d = a * b
Picture1.Print c
Picture2.Print d
Picture3.Print Date & vbNewLine & Time
End Sub
Private Sub Command2_Click()
Form1.Show
End Sub
Private Sub Form_Load()
End Sub 展开
我的form1文件是
Private Sub Command1_Click()
Form2.Show
End Sub
Private Sub Form_Load()
Dim a As String
a = InputBox("请输入账号")
Dim username(0 To 3) As String
username(0) = "wangzhiyao"
username(2) = "wanglongxiang"
username(1) = "dujiao"
username(3) = "liangjun"
Dim flag As Boolean
flag = False
Dim i As Integer
For i = 0 To 3
If a = username(i) Then
flag = True
End If
Next i
If flag = False Then
MsgBox "账号输入错误,( ^_^ )/~~拜拜"
End
End If
End Sub
Private Sub Picture1_Paint()
Picture1.Print "欢迎来到未知世界作用领域"
End Sub
form2文件是
Private Sub Command1_Click()
Dim a, b, c, d As String
a = Text1.Text
b = Text2.Text
c = (a + b) * 2
d = a * b
Picture1.Print c
Picture2.Print d
Picture3.Print Date & vbNewLine & Time
End Sub
Private Sub Command2_Click()
Form1.Show
End Sub
Private Sub Form_Load()
End Sub 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询