Hello,
I've been trying to implement a custom OwnerDraw ToolTip that will
display when the mouse is hovering over a TreeNode. So far I have the
ToolTip coming up and drawing properly through my custom ToolTip.Draw
Handler, but the tool tip tip image is showned after the mouse leave on the node..
i need to appear the tool tip when the mouse is hover on the node,not after leaving the node ..
Any one pls help me
Thanks in advance...
here is my code
private void trvObjects_NodeMouseHover(object sender, TreeNodeMouseHoverEventArgs e)
{
CustomizedToolTip myToolTip1 = new CustomizedToolTip();
myToolTip1.SetToolTip(this.treview1, "test");
}
<b>
CustomizedToolTip.cs custom control code </b>
void CustomizedToolTip_Draw(object sender, DrawToolTipEventArgs e)
{
//if (object.ReferenceEquals(e.AssociatedControl, ))
//{
// // Draw the custom background.
using (System.Drawing.Drawing2D.LinearGradientBrush brush = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, Color.AntiqueWhite, Color.CornflowerBlue, System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal))
{
e.Graphics.FillRectangle(brush, e.Bounds);
}
//Draw the border (default).
e.DrawBorder();
//Image _img = Image.FromFile(_imgfilename);
Bitmap image = new Bitmap(&quot;D:\\test.jpg&quot;);
e.Graphics.DrawImage(image, 0, 0, 256, 256);
// }
}
void CustomizedToolTip_Popup(object sender, PopupEventArgs e)
{
// if (object.ReferenceEquals(e.AssociatedControl, myctr))
// {
e.ToolTipSize = new Size(256, 256);
// }
}