473,799 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show a tooltip programmaticall y

How can I show a tooltip programmaticall y? 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 39755
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 _ToolTipInterva l = 3000;
public virtual int ToolTipInterval
{
get { return _ToolTipInterva l; }
set { _ToolTipInterva l = value; }
}

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

protected override void OnMouseHover(Ev entArgs e)
{
base.OnMouseHov er(e);
toolTip.Show("Z Index: " + this.ZIndex.ToS tring(),
this, 5, 5, ToolTipInterval );
}

public blah()
{
this.toolTip = new System.Windows. Forms.ToolTip(t his.components) ;
this.toolTip.Au toPopDelay = 5000;
this.toolTip.In itialDelay = 250;
this.toolTip.Re showDelay = 50;
this.toolTip.Sh owAlways = 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 programmaticall y? 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("Z Index: " + this.ZIndex.ToS tring(),
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
16155
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 tooltip on mouse over? Thanks Rjn
4
1908
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 somethink like this/but this is wrong/ listview.tooltip="Hello" Thak for answer.
1
6612
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. Private Sub MyControl_MouseEnter() Dim myToolTip as New ToolTip() myToolTip.SetToolTip(myControl,"Hello") End Sub
0
2626
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) { _hwnd = handle; } public IntPtr Handle { get { return _hwnd; } } private IntPtr _hwnd; } But when I call the following
0
2144
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 tooltip) and resize it using the ToolTipSize property. In the Draw event, I draw my tooltip.
0
4533
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 tooltip) and resize it using the ToolTipSize property. In the Draw event, I draw my tooltip.
0
10705
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) coordinates. But if the (x,y) coordinates are too far to the right, then the "tip" of the balloon now points to some spurious coordinate that's unrelated to my (x,y). Why? How can I stop this? How can I make the balloon's tip point exactly where I...
3
6516
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 the row being hovered. How can I do that ?
4
3633
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 ToolTip automaticly for all these controls, without having to link it the whole time to them for every new Control I put on my Forms? And regarding the DataGridView: The ToolTip doesn't show the whole value of every Cell, but cuts it off when...
0
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10238
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.