title: Trying to get the highest goal scorer in a list of players, goals
body: <pre><code>public class Player
  { 
      public string Name { get; private set; }
      public string Firstname { get; private set; }
      public Ploeg Team { get; private set; }
      public int Goal { get; set; }
  }
  public class GlobalCollection
  {
      public List&lt;Ploeg&gt; PloegCollection { get; private set; }
      public List&lt;Speler&gt; SpelerCollection { get; private set; }
  }
  public GlobalCollection()
  {
          SpelerCollection.Add(new Speler("Stanciu", "Nicolae", p1 , 0));
          SpelerCollection.Add(new Speler("Massimo", "Bruno", p1 , 0));
          SpelerCollection.Add(new Speler("Hanni", "Sofiane", p1 , 0));
          SpelerCollection.Add(new Speler("Teodorczyk", "Lukasz", p1, 0));
  }
  </code></pre>
  
  <p>I have a button who sets the goals +1.</p>
  
  <pre><code>    private void goalButton_Click(object sender, EventArgs e)
      {
          if (ploeg1ListBox.SelectedIndex &gt;= 1)
          {
              Player pl = (Player)team1ListBox.SelectedItem;
              pl.player++;
              GoalForm goal = new GoalForm(); //winform with picture
              goal.ShowDialog();
          }
  </code></pre>
  
  <p>now i want to show with a button click the highest goal scorer. I tried using maxvalue and so on..</p>
  
  <pre><code>  foreach(Speler sp in data.SpelerCollection)
    {
        for (int counter = 0; counter &gt; data.SpelerCollection.Count;counter++)
        {
  </code></pre>
  
  <p>i can't seem to find the right code for my little program, could you help me guys?</p>
  
  <p>Grts</p>