all groups > dotnet general > april 2006 >
You're in the

dotnet general

group:

Simple question


Simple question Rudy
4/16/2006 9:24:01 PM
dotnet general: 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!!!

Re: Simple question Cor Ligthert [MVP]
4/17/2006 12:00:00 AM
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

"Rudy" <Rudy@discussions.microsoft.com> schreef in bericht
news:0CB9DE83-BBC8-4E5B-9994-28C4E2CF6E07@microsoft.com...
[quoted text, click to view]

Re: Simple question Rudy
4/17/2006 5:07:01 AM
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

[quoted text, click to view]
Re: Simple question cnickl
4/17/2006 7:52:03 AM
Can you give the value from Form1 as a parameter to Form2 in its constructer?

[quoted text, click to view]
Re: Simple question Cor Ligthert [MVP]
4/17/2006 3:09:49 PM
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

"Rudy" <Rudy@discussions.microsoft.com> schreef in bericht
news:05CC882E-6D0E-4751-B529-F34EFE0FC562@microsoft.com...
[quoted text, click to view]

Re: Simple question Rudy
4/17/2006 4:45:02 PM
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

[quoted text, click to view]
AddThis Social Bookmark Button