By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,888 Members | 1,232 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,888 IT Pros & Developers. It's quick & easy.

How to pass parameter between vb.net forms

P: n/a
Hi

Can anyone help me with my problem. I've created 2 forms. Each has a local
variable. How can I pass the st2 string in form2 to st1 in form1.

Example
form1:
dim str1 as string

form2:
dim st2 as string
Please help. Thanks

Regards
Melson
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I'm not sure... do these forms have a parent form?
Does one launch the other?

Obviously you could have a

ReadOnly Public Property String1 as string
Get
Nov 21 '05 #2

P: n/a
Melson,

Absolute in the top 10 of the most asked questions in this newsgroup

Maybe does one of these answers fits you

http://groups-beta.google.com/group/...rch+this+group

I hope this helps,

Cor
Nov 21 '05 #3

P: n/a
Declare it as Shared.

Public Shared st2 as string

str1 = form2.st2

Or create a module and declare str1 and st2 in the module, then access from
either form.

"Melson" <we****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi

Can anyone help me with my problem. I've created 2 forms. Each has a local
variable. How can I pass the st2 string in form2 to st1 in form1.

Example
form1:
dim str1 as string

form2:
dim st2 as string
Please help. Thanks

Regards
Melson

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.