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<Ploeg> PloegCollection { get; private set; }
public List<Speler> 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));
}
私はゴール+1を設定するボタンを持っています。選手のリストで最高の得点を得ようとしています
private void goalButton_Click(object sender, EventArgs e)
{
if (ploeg1ListBox.SelectedIndex >= 1)
{
Player pl = (Player)team1ListBox.SelectedItem;
pl.player++;
GoalForm goal = new GoalForm(); //winform with picture
goal.ShowDialog();
}
ここでは、最高のゴールのスコアラーをクリックすると表示されます。私はMAXVALUEを使用してみましたので、..に
foreach(Speler sp in data.SpelerCollection)
{
for (int counter = 0; counter > data.SpelerCollection.Count;counter++)
{
を私は私の小さなプログラムのための右のコードを見つけることができないよう、あなたは私の男を助けることができますか?
Grtsないのはなぜ
あなたは最高得点のプレイヤーを取得するには、 'Max'を使用することができます。 – nbokmans