Simple question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All!

I know I can do this, just can't remeber how I did it. I want to take a
value that is in a "Form1" textbox, and pass that value to a "Form2" textbox
or label.

Thanks!!!

Rudy
 
Rudy,

That completely depend how you start the showing of your form2.

With a showdialog it is very easy.
With a show if becomes direct more diferent (depending which form has the
focus)

So can you tell how you start the showing of form2?

Cor
 
Hi Cor!

Form1 is a basic login page with a "enter" button. After the button is hit,
the last line of that enter click event is Form2.Show. So Form2 has the
focus, and I have imported Form1 into Form2 at the top of Form2 code.
"Imports.ApplicationName.Form1.

Thanks for your help on this!!

Rudy
 
Rudy,

You know that this is terrible OOP. Are you not able to use a shared/static
class (as well not nice but much better).

Than both forms get there information from that.

Public Class MyShared
Friend shared mlabeltext as string
End Class

This you can use than in both forms as myShared.mLabeltext

If you use than properties than it is even better.

I hope this helps

Cor
 
Hi Cor!

Had know idea that was terrible OOP. I'll try the share class, I never did
one before so i 'll have to look into it.

CN, I'm not sure what you mean?

Thanks!

Rudy
 
Back
Top