elianeasmar
Well-known member
- Joined
- Oct 3, 2013
- Messages
- 76
- Programming Experience
- Beginner

Hello.
I have a question. Is deleting an item from an array is similar to deleting an item from a structure?
i have this structure:
Public Structure _schoolinfo Public Code As String Public Name As String Public PhoneNumber As String Public Address As String Public Sex As String Public Title As String Public Position As String End Structure
And i am saving it like this:
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click _info = New _schoolinfo With _info .Code = txtCode.Text .Name = txtName.Text .PhoneNumber = txtPhoneNumber.Text .Address = txtAddress.Text .Title = cmbTitle.Text .Position = cmbPosition.Text If RDFemale.Checked Then .Sex = "Female" If RDMale.Checked Then .Sex = "Male" End If End If End With If _infoschool = "I" Then index = _collection.Count + 1 _icollection.Add(New _schoolinfo With {.Code = txtCode.Text, .Name = txtName.Text, .PhoneNumber = txtPhoneNumber.Text, .Address = txtAddress.Text, .Title = cmbTitle.Text}) _collection.Add(_info, getkey(index)) Else '_info = New _schoolinfo If _collection Is Nothing Then _collection = New Collection If _collection.Count > 0 Then _collection.Remove(getkey(index)) _collection.Add(_info, getkey(index)) End If _inf = Nothing PrepareTextBox(False) RefreshControls("L") End Sub
if i want to delete an item from the structure, how am i suppose to delete it?
I am stuck. i tried 'nothing'. but i think this should empty the whole structure.
and i need to clear the item displayed on my screen :/
Any help?
Thank you
Last edited by a moderator: