求大神们帮做一个Vb程序要求如下有form1,form2两个窗口,在form1中text中输入数据
求大神们帮做一个Vb程序要求如下有form1,form2两个窗口,在form1中text中输入数据(ASCII码)后按下确定按钮在form2的text中显示相同的数据.f...
求大神们帮做一个Vb程序要求如下有form1,form2两个窗口,在form1中text中输入数据(ASCII码)后按下确定按钮在form 2的text中显示相同的数据.form1有17个text,form2对应的也有17个text,求代码谢谢
展开
2个回答
展开全部
'Form1中:
Private Sub Command1_Click()
Form2.Show
End Sub
Private Sub Form_Load()
Dim i As Integer
Text1(0).Text = ""
For i = 1 To 16
Load Text1(i)
If i Mod 2 = 1 Then
Text1(i).Left = Text1(i - 1).Left + 1500
Text1(i).Top = Text1(i - 1).Top
Else
Text1(i).Left = Text1(0).Left
Text1(i).Top = Text1(i - 1).Top + 500
End If
Text1(i).Visible = True
Next i
Command1.Caption = "显示Form2"
End Sub
Private Sub Text1_Change(Index As Integer)
sj(Index) = Text1(Index).Text
End Sub
'Form2中:
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i As Integer
Text1(0).Text = sj(0)
For i = 1 To 16
Load Text1(i)
If i Mod 2 = 1 Then
Text1(i).Left = Text1(i - 1).Left + 1500
Text1(i).Top = Text1(i - 1).Top
Else
Text1(i).Left = Text1(0).Left
Text1(i).Top = Text1(i - 1).Top + 500
End If
Text1(i).Visible = True
Text1(i).Text = sj(i)
Next i
Command1.Caption = "关闭"
End Sub
'标准模块Module1中:
Public sj(16) As String
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询