0

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

2
Contributors
10
Replies
12
Views
5 Years
Discussion Span
Last Post by bangor_boy
0

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

Also, what error are you getting?

Edited by thines01: clarity

0

This method isnt working

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

It looks like it should be

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

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

Edited by thines01: typo

0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.