473,386 Members | 1,757 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,386 software developers and data experts.

Value of TBox from Different Form

I know this is simple but I am stumped. Trying to get the
value of a TextBox from another form. Form name is
frmStart and Tbox name is tbxInis. In vb6 I could just
use frmStart.tbxInis.text but Can not figure out how to do
this in .Net. Please help is easy answer
Jul 21 '05 #1
3 1244
Pass the value in the new form's constructor and/or set a property of the
second form that's public and then set it from the first form....
"Bills" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl...
I know this is simple but I am stumped. Trying to get the
value of a TextBox from another form. Form name is
frmStart and Tbox name is tbxInis. In vb6 I could just
use frmStart.tbxInis.text but Can not figure out how to do
this in .Net. Please help is easy answer

Jul 21 '05 #2
How do you pass the value in the new form's constructor?

-----Original Message-----
Pass the value in the new form's constructor and/or set a property of thesecond form that's public and then set it from the first form...."Bills" <an*******@discussions.microsoft.com> wrote in messagenews:08****************************@phx.gbl...
I know this is simple but I am stumped. Trying to get the value of a TextBox from another form. Form name is
frmStart and Tbox name is tbxInis. In vb6 I could just
use frmStart.tbxInis.text but Can not figure out how to do this in .Net. Please help is easy answer

.

Jul 21 '05 #3
here's an example in VB.NET (the method NEW is the constructor for the form)
#Region " Windows Form Designer generated code "
Dim a As String
Public Sub New(ByVal varToPass As String)
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
a = varToPass
'Add any initialization after the InitializeComponent() call
End Sub
#Region " Windows Form Designer generated code "
Dim a As String
Public Sub New(ByVal varToPass As String)
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
a = varToPass
'Add any initialization after the InitializeComponent() call
End Sub

i declared a variable in the new's paramater list and assigned it to a
private variable that is in the scope of the form only then gave it the
value of the paramater pased through the constructor
when you call this form another form you would have to do something like
this
Dim f As New Form1("text")
f.Show()
"bills" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
How do you pass the value in the new form's constructor?

-----Original Message-----
Pass the value in the new form's constructor and/or set a

property of the
second form that's public and then set it from the first

form....
"Bills" <an*******@discussions.microsoft.com> wrote in

message
news:08****************************@phx.gbl...
I know this is simple but I am stumped. Trying to get the value of a TextBox from another form. Form name is
frmStart and Tbox name is tbxInis. In vb6 I could just
use frmStart.tbxInis.text but Can not figure out how to do this in .Net. Please help is easy answer

.

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get...
8
by: Matt Herson | last post by:
I have been trying to find a way to use JavaScript to change the value of a hidden field on submit. I am already invoking a JavaScript to handle the validation on submit. The reason I need to...
2
by: Ant | last post by:
Ok, so I have a regular input textbox on my webpage and I'm trying to work out how to make it so when the user presses a button the the textbox holds the value of a variable. I just can't work out...
5
by: Bernard Davis | last post by:
Hi, I need to pass the value held in a field in one form and have it appear in another form. I specifically don't want to have to refer to the original form name as it has passed, because I...
3
by: Bills | last post by:
I know this is simple but I am stumped. Trying to get the value of a TextBox from another form. Form name is frmStart and Tbox name is tbxInis. In vb6 I could just use frmStart.tbxInis.text but...
4
by: Torilyn73 | last post by:
I have a combo box set up off a query. I want the default value to be the column heading so I don't have to put a label over it. So far I haven't been able to figure this out. Can anyone tell me if...
2
by: paulcis | last post by:
I am trying to produce a dynamic form from a database with unknown amount of records. I need to read the values and create a new textbox for each. I need to create the textboxes at page_init stage...
2
by: Patrick A | last post by:
All, I have a form (FRM_ShowAll) on which I have placed a number of instances of the same sub-form (FRM_Assign) as different child forms (SFRM_Agent, SFRM_Executor, etc.). The sub-form is a...
1
by: sva0008 | last post by:
hi , I am using. <input type=button class=tbox value="Populate SA" style="width: 90%"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.