Form1 open Form2, Form2 how to change text in Form1.label ?

  • Thread starter Thread starter Tee
  • Start date Start date
T

Tee

Hi,

I have 2 form, Form1 and Form2.

in Form1:

dim Form2 as new Form2
Form2.show


in Form2, I have a button there, and it should change the text in Form1, but
to do it ?
now the situation is Form1 can change text in Form2, but Form2 do nothing to
Form1.


Thanks,
Tee
 
Hi Ferfried,

Does that mean if Form2 is opened from Form1, Form2 must "locate" the label
in Form1 by using this method ?

Are we still possible to do like vb6, form1.label.text = something,
form3.label.text = something ?


so if got 3 form, form1 open form2 & form3, how form2 change the text in
form3's label ?

Please help.


Thanks,
Tee
 
* "Tee said:
Does that mean if Form2 is opened from Form1, Form2 must "locate" the label
in Form1 by using this method ?

There are various methods, but all you need, is a /reference/ to the
other form/control.
Are we still possible to do like vb6, form1.label.text = something,
form3.label.text = something ?

No. Default instances are not supported any more.
so if got 3 form, form1 open form2 & form3, how form2 change the text in
form3's label ?

You will have to pass a reference to this form too.
 
Back
Top