Please help before i go mad, i need to use the update in the main class to access the list in the footballadmin and then display each in a list box but i cant get it to work.

Imports Football

Public Class FootballAdmin

  Private fTeam As List(Of FootballTeams)

  Public Sub New()
    fTeam = New List(Of FootballTeams)
  End Sub

  Public ReadOnly Property Teams() As List(Of FootballTeams)
    Get
      Return fTeams
   End Get
  End Property
End Class
Public Class MainForm    
  Private fFootballAdmin As FootballAdmin

  Public Sub New()
    InitializeComponent()
    fFootballAdmin = New FootballAdmin
    updateView()
  End Sub

  Private sub updateView()    
    For each team As List(of fFootballAdmin) In fFootballAdmin.Teams()
      teamSheetListBox.Items.Add(team.ToString)
    Next   
  End Sub
End Class

Thanks

Is the first line 13 supposed to be return fTeam (instead of fTeams)?

Also, what error are you getting?

Edited 4 Years Ago by thines01: clarity

This method isnt working

Private sub updateView()
For each team As List(of fFootballAdmin) In fFootballAdmin.Teams()
teamSheetListBox.Items.Add(team.ToString)
Next

It looks like it should be

For each team As FootballTeams in fFootballAdmin.Teams()
   ' code goes here
Next

Maybe you should add "Imports Football" to the top of that module.
...unless it's really not defined anywhere.

Edited 4 Years Ago by thines01: typo

But is that not the point of

Private fFootballAdmin As FootballAdmin, so it will bring the import in or is that not the case.

This question has already been answered. Start a new discussion instead.