M
Mike in Paradise
Question: How do you reset the ToolTip that is showing
withing a control?
I have an image in a control. Within that image there are
various parts that make up the item being displayed.
I hittest the image and find out which part it is and
load the ToolTip to display part information and this
works fine for the first part.
The challenge is that I would like the tool tip to be
reset when the user moves the mouse so that they can
hoover over a different part of the image and get a new
ToolTip message with the new part of the image that they
are now hovering over.
I found some suggestions that said to change the tooltip
active flag but I tried this and it does not work.
Any suggestions would be appreciated.
Thanks
// Save the X,Y on move to pickup the part with
//
private void layout_Picture_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
this.layout_MouseX = e.X;
this.layout_MouseY = e.Y;
//Tried resetting here but no luck
//toolTip1.Active = false;
//toolTip1.Active = true;
}
private void layout_Picture_MouseHover(object sender,
System.EventArgs e)
{
int partNumber = GetPartonLayout
(layout_MouseX,layout_MouseY );
if (partNumber > 0 && partNumber <= parts_Box.Items.Count)
{
APart aPart = (APart)parts_Box.Items[partNumber - 1];
this.toolTip1.SetToolTip(this.layout_Picture
,aPart.PartName
+",L="+aPart.Length.ToString() );
}
else
{
this.toolTip1.SetToolTip(this.layout_Picture
,"Click on a Part to select it, Hover mouse over a part
to see its Length");
}
}
withing a control?
I have an image in a control. Within that image there are
various parts that make up the item being displayed.
I hittest the image and find out which part it is and
load the ToolTip to display part information and this
works fine for the first part.
The challenge is that I would like the tool tip to be
reset when the user moves the mouse so that they can
hoover over a different part of the image and get a new
ToolTip message with the new part of the image that they
are now hovering over.
I found some suggestions that said to change the tooltip
active flag but I tried this and it does not work.
Any suggestions would be appreciated.
Thanks
// Save the X,Y on move to pickup the part with
//
private void layout_Picture_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
this.layout_MouseX = e.X;
this.layout_MouseY = e.Y;
//Tried resetting here but no luck
//toolTip1.Active = false;
//toolTip1.Active = true;
}
private void layout_Picture_MouseHover(object sender,
System.EventArgs e)
{
int partNumber = GetPartonLayout
(layout_MouseX,layout_MouseY );
if (partNumber > 0 && partNumber <= parts_Box.Items.Count)
{
APart aPart = (APart)parts_Box.Items[partNumber - 1];
this.toolTip1.SetToolTip(this.layout_Picture
,aPart.PartName
+",L="+aPart.Length.ToString() );
}
else
{
this.toolTip1.SetToolTip(this.layout_Picture
,"Click on a Part to select it, Hover mouse over a part
to see its Length");
}
}