I am trying to define an object in one form, and then when the user clicks a button, the object will be added to a new form that shows.
Form 1
Public Shared label As New Label
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
label.Text = "test"
End Sub
Form 2
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Controls.Add(Form1.label)
End Sub
Whenever I run this, it does not put the label on the second form. Can anyone tell me what I am doing wrong, or show a better way of doing this?