第1个回答 2011-05-03
vb6 动态运行vb6语句可以使用
Microsoft Script Control
Private Sub Form_Load()
Text1.Text = "cmdText1.Visible = False"
Call ScriptControl1.AddObject(cmdText1.Name, cmdText1)
End Sub
Private Sub Command1_Click()
Call ScriptControl1.ExecuteStatement(Text1.Text)
End Sub
但是你把事件绑定都放在文本里,我没有试过,你试试看看
http://support.microsoft.com/kb/184745
第3个回答 2011-05-03
form1中:
Private Sub Command1_Click()
Open "D:\123.txt" For Append As #1
Write #1, "张一:", Text1.Text
Write #1, "张二:", Text2.Text
Write #1, "张三:", Text3.Text
Write #1, "张四:", Text4.Text
Close
End Sub
form2中:
Private Sub Command1_Click()
Open "D:\123.txt" For Append As #1
Write #1, "张五:", Text1.Text
Write #1, "张六:", Text2.Text
Write #1, "张七:", Text3.Text
Close
End Sub
form3中:
Private Sub Command1_Click()
Open "D:\123.txt" For Append As #1
Write #1, "李四:", Text1.Text
Write #1, "王麻子:", Text2.Text
Close
End Sub
上面都是分行保存,如果在一行保存:
Write #1, "张一:", Text1.Text & " ", "张二:", Text2.Text & " ", "张三:", Text3.Text & " ", "张四:", Text4.Text
写在一行即可。" "是各记录中的空格(每个数据间空6个字符间距)
第4个回答 2011-05-05
form1中:
Private Sub Command1_Click()
Open "D:\123.txt" For Append As #1
Write #1, "张一:", Text1.Text
Write #1, "张二:", Text2.Text
Write #1, "张三:", Text3.Text
Write #1, "张四:", Text4.Text
Close
End Sub
form2中:
Private Sub Command1_Click()
Open "D:\123.txt" For Append As #1
Write #1, "张五:", Text1.Text
Write #1, "张六:", Text2.Text
Write #1, "张七:", Text3.Text
Close
End Sub
form3中:
Private Sub Command1_Click()
Open "D:\123.txt" For Append As #1
Write #1, "李四:", Text1.Text
Write #1, "王麻子:", Text2.Text
Close
End Sub
上面都是分行保存,如果在一行保存:
Write #1, "张一:", Text1.Text & " ", "张二:", Text2.Text & " ", "张三:", Text3.Text & " ", "张四:", Text4.Text
写在一行即可。" "是各记录中的空格(每个数据间空6个字符间距)
另外,团IDC网上有许多产品团购,便宜有口碑