Passing value From second & third Form

  • Thread starter Thread starter malikasad
  • Start date Start date
M

malikasad

Guest
Hi Friends,

I am calling from Form1 from Main Form and then from Form2 from Form1 I want to change texttbox1 (Form1) value from

Form2 without recalling the new form of Form1 , I not could pass value code as below



Main Form code


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


Dim f1 As New Form1
f1.TextBox1.Text = "From Form1"
f1.TextBox2.Text = "From Form1"
f1.ShowDialog()

End Sub


Form1 Code as below

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f2 As New Form2
f2.TextBox1.Text = "From Form2"
f2.TextBox2.Text = "From Form2"
f2.ShowDialog()
End Sub


FORM3 CODE

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Form1.TextBox1.Text = "from form2"
Form1.TextBox2.Text = "from form2"

End Sub

Code in form3 not working and value not changing unless I will call new instance of Form1, I want without calling

new instance of Form1 the value will be change.

thank you










asad

Continue reading...
 
Back
Top