Dim X As New frmFORM1()
X.txtTEXTBOXONE.Text = "TEST"
:confused:
i have this on one form called frmFORM2 why does it not send the text to frmFORM2 ?:confused:
Can anyone help
Thanks
Printable View
Dim X As New frmFORM1()
X.txtTEXTBOXONE.Text = "TEST"
:confused:
i have this on one form called frmFORM2 why does it not send the text to frmFORM2 ?:confused:
Can anyone help
Thanks
what are you doing exactly? so you have two open forms and you're trying to change the text of a textbox on another form? Umm you have to have a refrence to the other form, you cant just declare a new variable.Quote:
Originally posted by Stick
Dim X As New frmFORM1()
X.txtTEXTBOXONE.Text = "TEST"
:confused:
i have this on one form called frmFORM2 why does it not send the text to frmFORM2 ?:confused:
Can anyone help
Thanks
search the forum if that's what you want to do... a few billion people including me have asked this before:D:D
then i call the textboxQuote:
Dim X As New frmFORM1
this code it one the frmForm2Quote:
X.txtTEXTBOXONE.Text = "TEST"
Thanks
You still have not explained it very well.
But your code has nothing to do with frmForm2, you have no references to it at all.
e.g
' Create a new instance of frmForm1
Dim X As New frmFORM1
'Put the text "TEST" into the textbox on the new instance of frmForm1
X.txtTEXTBOXONE.Text = "TEST"
You have to remember the BIG fact that everything in VB.net has to be a instance of an object. You might want to have a good read on the differences between vb6 and vb.net.
if frmFORM1 is already open then your code wont work cause you create and work with a new isntance if it, not the one which is open. If not open then when u open it txtTEXTBOXONE.Text value should be the one you specified here.
Hey that makes sense thanks alot
Is there anyway to change a textbox on one form from another form while they are both open?
Thanks
:confused:
Yes,
Refere to the third reply of this thread:
http://www.vbforums.com/showthread.p...a+across+forms