vb怎么在fomr单击命令按钮,输出的信息在form2显示?
form1.hide,form2.show我试过了,输出的信息不回显示在form2.我的代码在下面PrivateSubCommand1_Click()Dimstrname...
form1.hide,form2.show我试过了,输出的信息不回显示在form2.
我的代码在下面
Private Sub Command1_Click()
Dim strname As String
Open "d:\he.txt" For Input As #1
While Not EOF(1)
Line Input #1, strname
Print strname
Wend
Close #1
End Sub
另外问下,如果, 进行姓名查询,用if逐行进行筛选,怎么做?昨天做了个,运行不起来。代码太长追问不了 - - 展开
我的代码在下面
Private Sub Command1_Click()
Dim strname As String
Open "d:\he.txt" For Input As #1
While Not EOF(1)
Line Input #1, strname
Print strname
Wend
Close #1
End Sub
另外问下,如果, 进行姓名查询,用if逐行进行筛选,怎么做?昨天做了个,运行不起来。代码太长追问不了 - - 展开
2014-06-25
展开全部
添加一个模块Module1:
Public str1 As String
Form2中:
Private Sub Form_Load()
Show
Print str1
End Sub
Form1中:
Private Sub Command1_Click()
Dim strname As String
Open "d:\he.txt" For Input As #1
While Not EOF(1)
Line Input #1, strname
'Print strname
str1=str1 & strname & vbcrlf
Wend
Close #1
Form2.show
End Sub
Public str1 As String
Form2中:
Private Sub Form_Load()
Show
Print str1
End Sub
Form1中:
Private Sub Command1_Click()
Dim strname As String
Open "d:\he.txt" For Input As #1
While Not EOF(1)
Line Input #1, strname
'Print strname
str1=str1 & strname & vbcrlf
Wend
Close #1
Form2.show
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Form2.Show()
Form2.Print "在窗体2打印"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim strname As String
Open "d:\he.txt" For Input As #1
While Not EOF(1)
Line Input #1, strname
Me.Hide
Form2.Show
Form2.Print strname
Wend
Close #1
End Sub
Dim strname As String
Open "d:\he.txt" For Input As #1
While Not EOF(1)
Line Input #1, strname
Me.Hide
Form2.Show
Form2.Print strname
Wend
Close #1
End Sub
追问
另外问下,如果, 进行姓名查询,用if逐行进行筛选,怎么做?昨天做了个,运行不起来。代码太长追问不了 - - ==加分,拜托了, 代码私信你可以吗?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询