VB.NET是由微软公司开发的一款专门面向对象的编程语言。可以帮助开发人员创造一个稳固性极强的开发环境,帮助编程人员提高开发效率。而且它还能对移动设备进行操作,体现了其功能的强大性。#t#
Form1.vb的VB.NET窗体传值代码:
- Private Sub Button1_Click
(ByVal sender As Object,
ByVal e As System.EventArgs)
Handles Button1.Click - form2.Instance(Me)
- form2.ShowDialog()
- End sub
Form2.vb的VB.NET窗体传值代码:
- Private frm1 As Form1
- Public Function Instance
(ByVal frm As Form1)- frmfrm1 = frm
- End Function
- Private Sub Form2_Load
(ByVal sender As Object,
ByVal e As System.EventArgs)
Handles MyBase.Load- Label1.Text = frm1.Label1.Text
- End sub
VB.NET窗体传值的相关代码编写就为大家介绍到这里。