Label1.Text = Form1.TextBox1.Text
Public Sub New(ByVal value As String) InitializeComponent() Label1.Text = valueEnd Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickDim f As New Form2(TextBox1.Text) f.Show()End Sub
‘ This will Call the Instance of the Open form on the zero index.Dim f As Form1 = Application.OpenForms(0)Label1.Text = f.TextBox1.Text
public void SetValue(string value) { label1.Text=value; }
Form2 f = new Form2(); f.SetValue(textBox1.Text); f.Show();
public Form2(string value) { InitializeComponent(); label1.Text = value; }
private void button2_Click(object sender, EventArgs e) { Form2 f = new Form2(textBox1.Text); f.Show(); }
Form1 f = (Form1)Application.OpenForms[0];label1.Text = f.TextBoxValue;