I have an ArrayList filled with a bunch of Points and I want to loop over them, so I use this code:
for (int i = 0; i < currentClicks.Count; i++)
{
if (i > 0) // Skip the first click
{
clickPos = currentClicks[i];
prevPos = currentClicks[i - 1];
}
}
and I get this error on the clickPos
and prevPos
lines:
Cannot implicitly convert type 'object' to 'System.Drawing.Point'.
An explicit conversion exists (are you missing a cast?)
Why is this? I have clickPos
and prevPos
defined as so:
private System.Drawing.Point clickPos;
private System.Drawing.Point prevPos;
Edit
When I comment out the clickPos
and prevPos
lines and add
MessageBox.Show(currentClicks[i].GetType().ToString());
the message box says System.Drawing.Point