473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to pass parameter between vb.net forms

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
3 1264
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

110
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object...
15
by: deko | last post by:
I need a way to create a table with a programmatically defined name. I have a Make Table query that will create the table with the name that I put in the query, but I don't know how to (or if I...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
0
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems...
8
by: Brian F | last post by:
Exactly what the subject says. I have an ASP page that I want my C# windows application to open in Internet Explorer, and if possible have it send along a list of values from a list box. Thank you.
6
by: Vern | last post by:
I'd like to make the following a generic method that all my forms can call to validate all the fields on the form. So how do I pass the form object that is represented as "this" in the following...
3
by: Agnes | last post by:
There is a button in form A , as the users click it, Form B will show. however, how can i pass the parameter to form B . the parameters got (tablesname,search condition). As form B receive these...
1
by: woody | last post by:
I have a bit of a newbie question (basically stated in the subject of the posting). If need to get some data out of a SQL Server Database. Can I use a control from a form to supply a parameter. ...
3
by: Pia Stevens | last post by:
For a GUI CSharp program I could define command line parameter as well by declaring them in Main(): static void Main(string args) But how do I pass them easily to Form1 ? Or should I...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.