0
votes

i have 4 form : input, form1, form2, form3

input have 3 input : a, b, c
form1 label1 need form1.a
form2 label1 need form1.b
form3 label1 need form1.c

after i click a button in input, form1 show and in several second change to form 2 and that's happen to form2 too, it change to form3, and form3 change into form1. it looping the changing beetwen form

i try this code to send the value

Form1.label1.Text = a.Text
Form2.label1.Text = b.Text
Form3.label1.Text = c.Text

and i try this code to create the looping beetwen form
in form1

form2.show()
me.close  

in form2

form3.show()
me.close  

in form3

form1.show()
me.close  

the problem is the value sometimes missing and the form not loop like i want anymore
please help

1

1 Answers

0
votes

Define Private MyInput As String = "" right bellow your class name.

Add this sub to all forms

    Public Sub ContinueInit(ByVal input as string)
    Me.MyInput = input
    Me.Label1.Text = input
    End Sub

Then, in Button Clicks add this depends on what form you want to call:

form1.show()
form1.ContinueInit(a.text)
me.close

form2.show()
form2.ContinueInit(b.text)
me.close

form3.show()
form3.ContinueInit(c.text)
me.close  

I hope this helped you to solve your problem. There is an easier way to do it, but this is what I am doing since I got used to this method.