有两个窗体,form1,form2
在 form1中,button1_click
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f2 As New Form2()
f2.Owner = Me
f2.Show()
End Sub
在 form2中,button1_click
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f1 As New Form1()
f1 = Me.Owner
f1.TextBox1.Text = Me.TextBox1.Text
Me.Dispose()
End Sub
gbxcz(流星残月)
这样啊!
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Write("<script language=javascript>window.opener.Form1.Textbox1.value='AAA';window.close();</script>")
End Sub
怎么这么麻烦的?我试着这样,
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Hide()
Dim F As New Form2()
F.Show()
F.TextBox1.Text = Me.TextBox1.Text '两个窗体之间数据传输
End Sub
也可以将当前窗口的TEXT值传给FORM2