Hello everybody!
I've a problem with MouseMove event in a C# project using Visual Studio 2005.
This is my situation: there is a PictureBox (bigger than the panel in which it is) and I want that, when the user moves his mouse over some sensible areas (that are other invisible small PictureBox), the cursor has to become a hand.
In order to realize it, I wrote this code:
private void stradario_MouseMove(object sender, MouseEventArgs e)
{
int i;
bool Manina = false;
if ((e.X >= vertice[i].Location.X) && (e.X <= vertice[i].Location.X + 15) && (e.Y >= vertice[i].Location.Y) && (e.Y <= vertice[i].Location.Y + 15))
for (i = 0; i < 150; i++)
{
if (areaSensibile(vertice[i], e))
Manina = true;
}
if (Manina)
Cursor = Cursors.Hand;
else
Cursor = Cursors.Default;
}
But there is a problem: it works only if I don't scroll the picturebox! In facts, the cursor becomes a hand over the sensible areas that are situated in the top of the big PictureBox, but it doesn't do anything if I scroll the picturebox and I move my mouse over the areas in the bottom!
Any suggestion?