Hoi allemaal,
heb dit:
En de classe: Frame:
De volgende fout:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Maar wat moet er nou bij staan bij de classe: Frame? Want daar verwijst ie naar?
Ik kom er echt niet uit.
Heeft iemand een idee.
Alvast enorm bedankt!!
[/code]
heb dit:
Code:
private void SelectedPartChanged(object sender, EventArgs e)
{
if (FrameList.SelectedItem != null)
{
game.selFrame = FrameList.SelectedIndex;
}
if (FrameList.SelectedIndex >= 0)
{
int index = FrameList.SelectedIndex;
game.selPart = index;
partGrid.SelectedObject = game.charDef.frame[game.selFrame].partList[index];
//game.FrameList.Name.Replace;
}
}
En de classe: Frame:
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace xCharEdit.Character
{
public class Frame
{
public List<Part> partList;
public String name;
public Frame(String name)
{
partList = new List<Part>();
//for (int i = 0; i < partList.Count; i++)
// partList[i] = new Part();
this.name = name;
}
public Part addPart(Part _part)
{
partList.Add(_part);
return _part;
}
public Part GetPart(int idx)
{
for (int i = 0; i < partList.Count; i++)
//new CharDef();
//new Animation();
//animation.Add();
return (idx >= 0) ? partList[idx] : null;
//return null;
return partList[idx];
}
public void SetPart(int idx, Part _part)
{
partList[idx] = _part;
}
public List<Part> GetPartArray()
{
return partList;
}
}
}
Ik krijg bij deze regel:
[code]
partGrid.SelectedObject = game.charDef.frame[game.selFrame].partList[index];
De volgende fout:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Maar wat moet er nou bij staan bij de classe: Frame? Want daar verwijst ie naar?
Ik kom er echt niet uit.
Heeft iemand een idee.
Alvast enorm bedankt!!
[/code]