G
Guest
Hello All!
I have been trying to figure this out, have recieved alot of help, but it's
just not clicking in the ol' noggin. I basicly have a value in a text box, I
need to keep that value and pass it on to another textbox on another form.
I understand that there is a couple of ways of doing this, one by using a
public class. The other by a public property. Here is my feeble attempt.
Public Class FormA
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public x As Integer
Public y As String = TextBox1.text
Private Sub FormA_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim secondForm As New FormB
secondForm.Show()
secondForm.getForm1(Me)
End Sub
End Class
Public Class FormB
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Private Sub FormB_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Public Sub getForm1(ByVal theform As FormA)
theform.x = 6
theform.y = TextBoxB.Text
End Sub
End Class
I'm not sure where I'm going wrong on this. I feel I'm pretty close, just
missing something.
TIA!!
Rudy
I have been trying to figure this out, have recieved alot of help, but it's
just not clicking in the ol' noggin. I basicly have a value in a text box, I
need to keep that value and pass it on to another textbox on another form.
I understand that there is a couple of ways of doing this, one by using a
public class. The other by a public property. Here is my feeble attempt.
Public Class FormA
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public x As Integer
Public y As String = TextBox1.text
Private Sub FormA_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim secondForm As New FormB
secondForm.Show()
secondForm.getForm1(Me)
End Sub
End Class
Public Class FormB
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Private Sub FormB_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Public Sub getForm1(ByVal theform As FormA)
theform.x = 6
theform.y = TextBoxB.Text
End Sub
End Class
I'm not sure where I'm going wrong on this. I feel I'm pretty close, just
missing something.
TIA!!
Rudy