Hi again,
I am somewhat familiar with passing objects/variables across to a modal form. You set the public property of the form you are showing and send across the variable/list/object when creating the instance of the form:
And pick it up in the Private Sub New() of the modal form and set it to the public property.
I pass across my list, and in the form I make a few additions to the list. When the modal form is closed and I count my list, I don't have the additions that were made in the modal form. I'm obviously not grasping this but I though I was passing across the list so I could use it in the modal form. What seems to be happening is the list is copied into the opening form, the additions are made, and all this is discarded when the form closes again.
I have fixed this by:
I can pick up the list from the form that called the modal form by:
Is there any way just to send over my list to the modal form and allow the modal form to change it and keep the changes back in the parent form? Or am I way off here?
Thanks again for any help. This forum is very helpful!
I am somewhat familiar with passing objects/variables across to a modal form. You set the public property of the form you are showing and send across the variable/list/object when creating the instance of the form:
Code:
modalForm = new subForm(list)
modalForm.ShowDialog()
I pass across my list, and in the form I make a few additions to the list. When the modal form is closed and I count my list, I don't have the additions that were made in the modal form. I'm obviously not grasping this but I though I was passing across the list so I could use it in the modal form. What seems to be happening is the list is copied into the opening form, the additions are made, and all this is discarded when the form closes again.
I have fixed this by:
Code:
Public ReadOnly Property Jobs As List(Of Site)
Get
Return list
End Get
End Property
Code:
list = modalform.Jobs
Thanks again for any help. This forum is very helpful!