I haven't worked with VB in a long time, and I'm trying to add a membership object that includes a name, membership type, and additional options to a list when the user clicks a button. However as I step through my program in visual studio only the default data that is in my constructor is added to the list, not any of the data that i'm entering.
How can I get my data to successfully add to the list? Here's my code, any help would be appreciated
Dim memberList As New List(Of Membership)
Dim newMembership As New Membership
Here's my submit button
If MessageBox.Show("Do you wish to write this change to a file?",
"Write to file", MessageBoxButtons.YesNo, MessageBoxIcon.Hand,
MessageBoxDefaultButton.Button2) = DialogResult.Yes Then
memberList.Add(newMembership)
MessageBox.Show("Added to list")
Default constructor
'default
Public Sub New()
memberType = "Single"
golf = False
tennis = False
Raquetball = False
memberName = "Default"
Overloaded constructor
'overloaded
Public Sub New(ByVal mt As String, ByVal g As Boolean, ByVal t As Boolean, ByVal n As String, ByVal R As Boolean)
memberType = mt
golf = g
tennis = t
memberName = n
Raquetball = R
End Sub
My list when I click submit
golf False Boolean
memberName "Default" String
memberType "Single" String
Raquetball False Boolean
tennis False Boolean
Only the default values are showing, I'm confused as to where I set the properties and get the correct information submitted into a list