I open a dialog with 2 buttons. Those buttons should set a property to a value and then close the form. My main form should then grab that property. Whenever I try to grab the value it's always blank.
My Main Form
Using SelectNextForm As New TubeSelectTo()
SelectNextForm.Focus()
If TubeSelectTo.ShowDialog(currentWO, status) = Windows.Forms.DialogResult.OK Then
MessageBox.Show(SelectNextForm.numberOfBins)
End If
The dialog
Private numberBins As String
Public Overloads Function ShowDialog(ByVal woID As String, ByVal currStatus As ResourceStatus) As DialogResult
Return Me.ShowDialog()
End Function
Public ReadOnly Property numberOfBins() As String
Get
Return numberBins
End Get
End Property
Private Sub btn1_Click(sender As System.Object, e As System.EventArgs) Handles btn1.Click
numberBins = "1"
DialogResult = Windows.Forms.DialogResult.OK
End Sub
Private Sub btn2_Click(sender As System.Object, e As System.EventArgs) Handles btn2.Click
numberBins = "2"
DialogResult = Windows.Forms.DialogResult.OK
End Sub
So why isn't my property being set?