在frmMain窗体定义
Public UserName As String
Public UserId As String
UserName="aaa"
在frmOrderList窗体中定义
Private UserName As String = ""
然后
Public Sub New(ByVal sUserName As String)
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
UserName = sUserName
End Sub
然后
Private Sub frmOrderList_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
txbListMaker.Text = UserName
End sub
不知道vb.net 如何引用另外一个窗体的变量,请哪位高手解答一下。Thanks