how to remove the exception, System.InvalidOperationException?
<p>code is given below </p>

<pre><code>Queue&lt;int&gt; queXpTrackerX = new Queue&lt;int&gt;(10);
Queue&lt;int&gt; queXpTrackerY = new Queue&lt;int&gt;(10);       

if (iCounterForXpTrack &lt; 10)
{
    queXpTrackerX.Enqueue(X);
    queXpTrackerY.Enqueue(Y);
    iCounterForXpTrack++;
}//End IF
else
{
    queXpTrackerX.Dequeue();
    queXpTrackerY.Dequeue();
    queXpTrackerX.Enqueue(X);
    queXpTrackerY.Enqueue(Y);
}//End else

for (int indexXp = 0; indexXp &lt; iCounterForXpTrack; indexXp++)
{
    gXpTracker.DrawEllipse(Pens.Cyan, queXpTrackerX.ElementAt(indexXp) , queXpTrackerY.ElementAt(indexXp), 5, 5);
}//end for
</code></pre>
