Answered by:
Passing value From second & third Form

Question
-
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.ClickDim 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 SubFORM3 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 SubCode 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
Wednesday, November 25, 2020 8:18 AM
Answers
-
Try two modifications:
Dim f1 = Form1
and
Dim f2 = Form2
- Marked as answer by malikasad Wednesday, November 25, 2020 10:05 AM
Wednesday, November 25, 2020 9:40 AM
All replies
-
Try two modifications:
Dim f1 = Form1
and
Dim f2 = Form2
- Marked as answer by malikasad Wednesday, November 25, 2020 10:05 AM
Wednesday, November 25, 2020 9:40 AM -
-
no I did not call show form its working fine
thank you
regards,
asad
asad
Wednesday, November 25, 2020 10:07 AM -
thank you its working fine
asad
Wednesday, November 25, 2020 10:08 AM