問題:CircleSegmentのコレクションがあり、PictureBoxでそれらをすべて描画しようとすると、pictureBoxのコレクションから最後のCircleSegmentのみを受け取ります。なんで?
ref class CircleSegment
{
public:
array<double>^ massive;
Pen^ Blackpen;
int index;
CircleSegment^ SegmentCircleCollection::operator [] ( const int a )
{
return this->Alfa[a];
}
....
}
ref class SegmentCircleCollection
{
public:
Generic::List<CircleSegment^> ^Alfa;
...
}
private: System::Void pictureBox1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e)
{
//Where SegmentCircleCollection^ myCollection;
for each(CircleSegment^ Selected in myCollection->Alfa)
{
e->Graphics->DrawLine(Selected->Blackpen,(int)Selected->massive[6],(int)Selected->massive[7],(int)Selected->massive[8],(int)Selected->massive[9]);
e->Graphics->DrawArc(Selected->Blackpen,(int)Selected->massive[0],(int)Selected->massive[1],(int)Selected->massive[2],(int)Selected->massive[3],(int)Selected->massive[4],(int)Selected->massive[5]);
}
..。
}