How to pass parameter between vb.net forms

M

Melson

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
 
S

Shane Story

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
 
M

Michael C#

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top