471,355 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,355 software developers and data experts.

Make a TextBox tooltip appear in-place (same as overly wide TreeView node texts)

I'm trying to mimic how the TreeView shows a full text inplace tooltip
when the mouse hovers over of TreeView node whose text is truncated
due to skinny form or panel.
In the IDE I have
Text1.text is 'A rather longish bit of text, may a really long
pathname or something similar';
ToolTip1.OwnerDraw is True (this causes ToolTip1_Draw() to run)

I was hoping this would work...

private void toolTip1_Draw(object sender, DrawToolTipEventArgs
e)
{
ToolTip1.Show(e.ToolTipText, e.AssociatedWindow,
0,0,5000);
}

But it throws Win32Exception .. Error creating window handle.

Can anyone recommend some quick and dirty code for doing inplace
tooltips ?

Sep 27 '07 #1
1 2652
Richard <ri************@devenezia.comwrote in
news:11*********************@n39g2000hsh.googlegro ups.com:
A rather longish bit of text, may a really long
pathname or something similar


private void textBox1_MouseHover(object sender, System.EventArgs e)
{
this.toolTip1.SetToolTip( ((TextBox)sender), ((TextBox)sender).Text );
this.toolTip1.Active = true;
}
Sep 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by watcher | last post: by
2 posts views Thread by melanieab | last post: by
2 posts views Thread by Edward | last post: by
4 posts views Thread by juergen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.