views:

124

answers:

1

I have a control inherited from usercontrol,

I have implemented it such a way that it acts as XY Plane and displays curves.

When user clicks and holds the mouse down for 1 sec i trigger SetToolTip to display tooltip indicationg (x,y) coordinates.

Tooltip remains even on drag updating x,y positions

System.Windows.Forms.ToolTip myToolTip = new System.Windows.Forms.ToolTip();
myToolTip.SetToolTip(myControl,"x= val,y=val");

It is working fine

But

Tooltip stops showing after

(1)I play around for sometime(click,drag repeatedly) and will never show up

(2)I move some other window on this control(this happens sporadically)

what could be the problem???

A: 

I'm not sure, but you can declase your "myToolTip" earlier and use it over and over, that might solve the problem. pseudo c# follows (long time i've seen some c#)

class plane : control
{
  private ToolTip myToolTip = new ToolTip();

  mousemove_handler()
  {
    myToolTip.SetToolTip(myControl,"x= val,y=val");
  }
}
Bastiaan Linders
I am doing exactly the same
Gaddigesh