views:

141

answers:

1

I want it to move when the mouse moves, and disappear when the pointer isn't over the label.

This doesn't work:

private void lblRevisionQuestion_MouseMove(object sender, MouseEventArgs e)
{
    toolTip1.Show("test", this, PointToClient(MousePosition), Int32.MaxValue);
}

private void lblRevisionQuestion_MouseLeave(object sender, EventArgs e)
{
    toolTip1.Hide(this);
}

As soon as the tooltip appears, it steals focus away from the form, evoking MouseLeave. Then the tooltip hides, and the pointer is once again over the label, invoking MouseMove. This results in a choppy, flashing tooltip.

Is there any way to do this?

A: 
toolTip1.Show(_toolTipText, this, new Point(lblRevisionQuestion.Left + e.X + 1, lblRevisionQuestion.Top + e.Y + 1), int.MaxValue);

Oddly enough, when I tried displaying it to some arbitrary coordinates eariler, it had the same problem as above. I don't know why this works and that didn't.

BlueRaja - Danny Pflughoeft