VB6.0 窗口启动后动态创建文本框之后,如何将创建的文本框中的数据保存下来?
我的代码如下:PrivateSubForm_Load()Form2.Controls.Add"VB.Textbox","T1",Form2WithForm2!T1.Vis...
我的代码如下:
Private Sub Form_Load()
Form2.Controls.Add "VB.Textbox", "T1", Form2
With Form2!T1
.Visible = True
.Height = 350
.Left = 6000
.Top = 960
.Width = 600
.Text = 0#
End With
Form2.Controls.Add "VB.Textbox", "T2", Form2
With Form2!T2
Private Sub Form_Load()
Form2.Controls.Add "VB.Textbox", "T1", Form2
With Form2!T1
.Visible = True
.Left = 6000
.Width = 600
.Text = 80
End With
End Sub
Private Sub Command1_Click()
Dim a As Integer
a = MsgBox("是否确认保存数据?", vbOKCancel + vbQuestion + vbDefaultButton1, "注意")
Select Case a
Case 1
Open App.Path & "\123.txt" For Output As #1
Print #1, T1.Text
Close #1
End Select
End Sub 可是运行之后错误424,调试指向的是print #1,T1.text一句?
代码复制错了,不用回答了,谢谢各位 展开
Private Sub Form_Load()
Form2.Controls.Add "VB.Textbox", "T1", Form2
With Form2!T1
.Visible = True
.Height = 350
.Left = 6000
.Top = 960
.Width = 600
.Text = 0#
End With
Form2.Controls.Add "VB.Textbox", "T2", Form2
With Form2!T2
Private Sub Form_Load()
Form2.Controls.Add "VB.Textbox", "T1", Form2
With Form2!T1
.Visible = True
.Left = 6000
.Width = 600
.Text = 80
End With
End Sub
Private Sub Command1_Click()
Dim a As Integer
a = MsgBox("是否确认保存数据?", vbOKCancel + vbQuestion + vbDefaultButton1, "注意")
Select Case a
Case 1
Open App.Path & "\123.txt" For Output As #1
Print #1, T1.Text
Close #1
End Select
End Sub 可是运行之后错误424,调试指向的是print #1,T1.text一句?
代码复制错了,不用回答了,谢谢各位 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询