472,782 Members | 1,327 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 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 2732
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: watcher | last post by:
I want to write some words to tell the user what is the TextBox's requirement when user mouse hover a TextBox,but i could not find out this attribute. many thanks.
4
by: NH | last post by:
Hi, I just cannot get this to work. I want to make a cell editable in a datagrid only if the value of another cell is something specific. I am able to capture the value of the other cell via the...
2
by: melanieab | last post by:
Hi, Is there an easy way to say, on textboxHover, if the text inside the box isn't completely visible, have a popup tool come up showing the complete contents of the box? I'm guessing I need to...
5
by: John Dolinka | last post by:
I am trying to change a tooltip on an asp.net (framework 2) textbox with out a post back to the server. I can access many of the textbox properties and change them but not the tooltip. Below is a...
2
by: Edward | last post by:
I made a pure css tooltip which unfortunately appears UNDER the other tooltip links. Does anyone know how I can get it to appear ON TOP OFF all the other text on the page? example and code:...
4
by: juergen | last post by:
Hello everyone, I want to display a help text when in help mode in my application. Something like a tooltip. Now my application is a taskbar deskband and so not everything works what normally...
2
by: Vivek | last post by:
I have two html files Parent.htm and Child .htm Following is the code inside the Parent.htm: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title></title>...
5
by: casperrr | last post by:
Hi. I'm beginner to Javascript so my question maybe would sound dumb to you. Anyway, I'm editing a script for my blog and a line goes like this: document.write('<a href="' + alturl + '">' +...
2
daJunkCollector
by: daJunkCollector | last post by:
I am trying to display a column from a database table in the column of a datagrid. I am using a template column to display it. There are two things that are important to me: 1. If...
6
by: john | last post by:
I have the following textbox setup with Text & ToolTip Bindings as follows; I'm using Visual Studio 2008 VB: <asp:TextBox ID="txtDay1" runat="server" Text='<%# Eval("Day1") %>'...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.