0
第一種形式我有一個文本框,您可以在其中添加您的姓名,然後當您單擊下一個窗口時,第二種形式將彈出說我的名字是:您的名字。這很好,但是我怎麼能夠將稱爲OtherForm的第二個表單的名稱改爲我的名字,這樣當第二個表單彈出時,我的名字會出現在左上角而不是OtherForm?這是迄今爲止第一種和第二種形式的代碼。第二種形式在Visual Builder中不能正確加載?
主要形式代碼:
Public Class MainForm
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
End Sub
Public Sub Label1_Click(sender As Object, e As EventArgs) Handles
WindowName.TextChanged
End Sub
Public Sub WindowName_TextChanged(sender As Object, e As EventArgs)
End Sub
Public Sub OffButton_Click(sender As Object, e As EventArgs) Handles
OffButton.Click
Me.Close()
End Sub
Public Sub NextButton_Click(sender As Object, e As EventArgs) Handles
NextButton.Click
OtherForm.NameLabel.Text = WindowName.Text
OtherForm.Show()
End Sub
End Class
第二種形式被稱爲OtherForm
Public Class OtherForm
Public Sub CloseButton_Click(sender As Object, e As EventArgs) Handles
CloseButton.Click
Me.Close()
End Sub
Public Sub OtherForm_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
End Sub
Public Sub NameLabel_Click(sender As Object, e As EventArgs) Handles
NameLabel.Click
End Sub
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles
Label1.Click
End Sub
End Class