4
Structure turma
Public id_turma As Integer
Public nome_turma As String
End Structure
Structure Disciplina
Public id_disciplinas As Integer
Public nome_disciplina As Integer
End Structure
Public Class F_Contentor
Dim turmas As New List(Of turma)
Dim Disciplinas As New List(Of Disciplina)
Public Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
turmas.id_turma.add(1)
End Sub
I have this code. And give this error:
Error 1 'id_turma' is not a Member of 'System.Collections.Generic.List(Of Work_mod_16.turma)'. C: Users Alunop Desktop Work module 16 Work mod 16 Work mod 16 F_container.Vb 50 9 Work mod 16
What is the correct way to add an item to a list, using a structure?
Thank you for your help. I will do that. : ) (an aside): For this case, it would be an asset to use a class or to continue with the structures?
– lemario
In the meantime an answer has appeared that answers my question :p. Again, thank you.
– lemario
It depends on what you are going to do. By the size I would have the same structure. But you have to analyze other factors, for example the immutability. See more about the differences.
– Maniero
Where do you have an answer that answers? You cannot answer without knowing the case.
– Maniero
The one given by Deivid Ramon. But I’ll still read the topics you gave me. Thank you.
– lemario
Yes you’re right.
– lemario