C
Chaucer
Trying to pass variables between 2 forms. I think I have it all set up
correctly but I'm not getting my changes from form2 back into form1.
Well, before I get into that, here is what I am trying to do. Load
form1 with some default config values. When you want to change those
values, you load form2 and make your changes. These values need to be
imported back into form 1 for use. I'm not getting any build errors so
I think it's just my logic that is messed up somewhere.
Here's a portion of my code.
FORM1:
Public Class frmConfigBuilder
Inherits Form
'For form 2 to show
Dim frmTwo As New frmExcelColumns
Dim RowStart As Integer
Public Property passRowStart() As Integer
Get
Return RowStart
End Get
Set(ByVal Value As Integer)
RowStart = Value
End Set
End Property
Private Sub mnuExcelColumns_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles mnuExcelColumns.Click
frmTwo.Show()
End Sub
End Class
FORM2:
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOK.Click
Dim frmOne As New frmConfigBuilder
frmOne.passRowStart = txtRowStart.Text
Me.Hide()
End Sub
Any help would be greatly appreciated.
Thanks in advance.
correctly but I'm not getting my changes from form2 back into form1.
Well, before I get into that, here is what I am trying to do. Load
form1 with some default config values. When you want to change those
values, you load form2 and make your changes. These values need to be
imported back into form 1 for use. I'm not getting any build errors so
I think it's just my logic that is messed up somewhere.
Here's a portion of my code.
FORM1:
Public Class frmConfigBuilder
Inherits Form
'For form 2 to show
Dim frmTwo As New frmExcelColumns
Dim RowStart As Integer
Public Property passRowStart() As Integer
Get
Return RowStart
End Get
Set(ByVal Value As Integer)
RowStart = Value
End Set
End Property
Private Sub mnuExcelColumns_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles mnuExcelColumns.Click
frmTwo.Show()
End Sub
End Class
FORM2:
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnOK.Click
Dim frmOne As New frmConfigBuilder
frmOne.passRowStart = txtRowStart.Text
Me.Hide()
End Sub
Any help would be greatly appreciated.
Thanks in advance.