vb.net 窗体之间怎么传值
展开全部
方法很多,vb.net很简单的比如: Form2窗体的Textbox2属性设置为public,在Form1点击button1.
Dim frm As New Form2
frm.TextBox2.Text = "123"
frm.ShowDialog() 可以取到form1里面窗体传的值
还有一种方法:From1 :
Dim frm As New Form2
frm.Owner = Me
frm.ShowDialog()
from2 : Private frmParent As Form1
frmParent = Me.Owner
Me.TextBox2.Text = frmParent.TextBox1.Text
Dim frm As New Form2
frm.TextBox2.Text = "123"
frm.ShowDialog() 可以取到form1里面窗体传的值
还有一种方法:From1 :
Dim frm As New Form2
frm.Owner = Me
frm.ShowDialog()
from2 : Private frmParent As Form1
frmParent = Me.Owner
Me.TextBox2.Text = frmParent.TextBox1.Text
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询