2011-01-05, 12:08 PM
DrRusty Wrote:well upload it somewhere so we can play it
Okay, just don't hold your breath for it.
And I'm stuck.
Code:
void MineButton_Click(Object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
bool found = false;
for(int i = 1;i<y&&!found;++i)
for (int j = 1; j < x && !found; ++j)
{
[B] if (p[i,j].pic.Focus())[/B]
{ found = true;
if ((p[i,j].status == "Cover")|(p[i,j].status == "Marked"))
{
if (!began)
{ PlaceMine(i,j); }
}
}
}
}
...I'm trying to make it detect which picturebox is it clicking. I tried .Focus(), it reacts only to top left button, first one that is initialized. I also tried to get cursor's location and react to button at its location. But it returns cursor's location ON each button instead. Each button has 15 px height and width, and when I ask for cursor's location, I get only number under 15 no matter where I click.
tldr; I want to detect which picturebox it's clicking. What should I replace in that bold line?

