473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Show a tooltip programmatically

How can I show a tooltip programmatically? I want to make it appear
over a particular control at the specific time I choose, and not rely
on the user's mouse movements. I don't mind using some Windows API
call for this, if somebody can explain the parameters.

Eq.
May 8 '06 #1
2 39688
You don't need Windows API to do this at all. Use the ToolTip class.

public class blah : System.Windows.Forms.Control
{
private System.Windows.Forms.ToolTip toolTip;

protected int _ToolTipInterval = 3000;
public virtual int ToolTipInterval
{
get { return _ToolTipInterval; }
set { _ToolTipInterval = value; }
}

public string ToolTipText
{
get { return "TooTip"; }
}

protected override void OnMouseHover(EventArgs e)
{
base.OnMouseHover(e);
toolTip.Show("ZIndex: " + this.ZIndex.ToString(),
this, 5, 5, ToolTipInterval);
}

public blah()
{
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.toolTip.AutoPopDelay = 5000;
this.toolTip.InitialDelay = 250;
this.toolTip.ReshowDelay = 50;
this.toolTip.ShowAlways = true;
}

}

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Paul E Collins" <fi******************@CL4.org> wrote in message
news:V5******************************@bt.com...
How can I show a tooltip programmatically? I want to make it appear over a
particular control at the specific time I choose, and not rely on the
user's mouse movements. I don't mind using some Windows API call for this,
if somebody can explain the parameters.

Eq.

May 8 '06 #2
Kevin Spencer wrote:
[... sample code ...]
toolTip.Show("ZIndex: " + this.ZIndex.ToString(),
this, 5, 5, ToolTipInterval);


Sorry - I forgot to mention that I need this to work in .NET Framework
1.1, which (unlike 2.0) doesn't have the static ToolTip.Show method.
Any other suggestion?

Eq.
May 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: RJN | last post by:
Hi The texts in the dropdown are too long and the width is not sufficient to show the entire text. Increasing the width is not an option. Is there a way to show the selected item text as a...
4
by: Rado | last post by:
Hello. I´ve got one problem. I take on form one listview and one tooltip. I can in listview properties write something to tooltip. But I want change this text during program running. I want...
1
by: Sakharam Phapale | last post by:
Hi All, I have developed my own user control and created custom mouse enter event. I need to show ToolTip on mouse enter event. I have written following code for that, but it doesn't show ToolTip....
0
by: NvrBst | last post by:
Hello. I'm trying to display a tooltip to an external window. I have a wrapper class public class WindowWrapper : System.Windows.Forms.IWin32Window { public WindowWrapper(IntPtr handle) {...
0
by: EricL | last post by:
Hello, I have written a Custom Control which inherits from ToolTip and it is an OwnerDraw tooltip. In the Popup event I calculate the size of the tooltip I need to display (rather large...
0
by: EricL | last post by:
Hello, I have written a Custom Control which inherits from ToolTip and it is an OwnerDraw tooltip. In the Popup event I calculate the size of the tooltip I need to display (rather large...
0
by: Lucian Wischik | last post by:
I'm using ToolTip.Show(x,y,..) to show my balloon-style tooltip at a specified coordinate. Most of the time it works fine and the "tip" of the balloon points exactly to my specified (x,y)...
3
by: graphicsxp | last post by:
Hi, I would like to show a tooltip when the user move the mouse over the first column of my gridview. The tooltip should be bound to a field of the gridview's datasource that correspond to...
4
by: Pieter | last post by:
Hi, Using VB.NET 2.0, Windows Forms. I want the ToolTip to be shown on every TextBox, ComboBox and DataGridView continuously, and show the contence of these controls. Is there a way to add the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.