<p>How can I programatically cause a control's tooltip to show in a Winforms app without needing the mouse to hover over the control?  (P/Invoke is ok if necessary). </p>

[{'answer_id': 63471, 'author': 'Mark D', 'author_id': 7452, 'author_profile': 'https://Stackoverflow.com/users/7452', 'pm_score': 0, 'selected': False, 'text': '<p>This is the code I use:</p>\n\n<pre><code>static HWND hwndToolTip = NULL;\n\nvoid CreateToolTip( HWND hWndControl, TCHAR *tipText )\n{  \n    BOOL success;\n\n  if( hwndToolTip == NULL )\n  {\n    hwndToolTip = CreateWindow(  TOOLTIPS_CLASS, \n                                 NULL, \n                                 WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,                                     \n                                 CW_USEDEFAULT, CW_USEDEFAULT, \n                                 CW_USEDEFAULT, CW_USEDEFAULT,                                     \n                                 NULL, NULL,\n                                 hInstResource, \n                                 NULL ); \n  }\n\n  if( hwndToolTip )\n  { \n    TOOLINFO ti; \n\n    ti.cbSize   = sizeof(ti); \n    ti.uFlags   = TTF_TRANSPARENT | TTF_SUBCLASS; \n    ti.hwnd     = hWndControl; \n    ti.uId      = 0; \n    ti.hinst    = NULL; \n    ti.lpszText = tipText; \n\n    GetClientRect( hWndControl, &amp;ti.rect ); \n\n    success = SendMessage( hwndToolTip, TTM_ADDTOOL, 0, (LPARAM) &amp;ti ); \n  }\n}\n</code></pre>\n\n<p>Call CreateToolTip function to create a tool tip for a certain control.</p>\n'}, {'answer_id': 63482, 'author': 'Mark Ingram', 'author_id': 986, 'author_profile': 'https://Stackoverflow.com/users/986', 'pm_score': 3, 'selected': False, 'text': '<pre><code>System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();\nToolTip1.SetToolTip(this.textBox1, "Hello");\n</code></pre>\n\n<p>The tooltip will be set over the control "textBox1".</p>\n\n<p>Have a read here:</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/aa288412.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa288412.aspx</a></p>\n'}, {'answer_id': 63592, 'author': 'Keithius', 'author_id': 5956, 'author_profile': 'https://Stackoverflow.com/users/5956', 'pm_score': 6, 'selected': True, 'text': '<p>If you are using the <code>Tooltip</code> control on the form, you can do it like this:</p>\n\n<p><code>ToolTip1.Show("Text to display", Control)</code></p>\n\n<p>The <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.show.aspx" rel="noreferrer">MSDN documentation for the ToolTip control\'s "Show" method</a> has all the different variations on this and how to use them.</p>\n'}, {'answer_id': 1648895, 'author': 'John', 'author_id': 199548, 'author_profile': 'https://Stackoverflow.com/users/199548', 'pm_score': 1, 'selected': False, 'text': '<p>First You need to add tooltip control to the form\nSecond attach the tooltip control to some control you want the tooltip to show on (MyControl)\nThird do this:\nTooltip1.Show("My ToolTip Text", MyControl)</p>\n'}, {'answer_id': 12094327, 'author': 'tretyak', 'author_id': 133460, 'author_profile': 'https://Stackoverflow.com/users/133460', 'pm_score': 1, 'selected': False, 'text': '<p>Kevin, if you want to create your own balloon, read this link:<a href="http://www.microsoft.com/indonesia/msdn/pinvoke.aspx" rel="nofollow">Task 3: Showing Balloon tips</a>. There mentioned NativeMethods class with the TOOLTIPS_CLASS constant.</p>\n'}, {'answer_id': 15887382, 'author': 'Bruno Poulin', 'author_id': 2259073, 'author_profile': 'https://Stackoverflow.com/users/2259073', 'pm_score': 0, 'selected': False, 'text': '<p>If you create your variable private to the whole form, you will be able to call the sub for the and adjust the initialdelay.</p>\n\n<pre><code>Public Class MyForm        \nPrivate MyTooltip As New ToolTip        \n...        \nSub ApplyToolTips        \n\'For default        \nApplyToolTips (1000)        \nEnd Sub        \n\nSub ApplyTooltips (ByVal Delay as Integer)        \n\nMyTooltip .InitialDelay = Delay        \nMyTooltip.AutoPopDelay = 5000        \n...        \nMyTooltip.SetToolTip(Me.btnClose, "Close the form")        \n\nEnd Sub       \n\nPrivate Sub Btn_Click(sender As System.Object, e As System.EventArgs) Handles Btn.Click           \n    Dim PicBox As PictureBox = CType(sender, PictureBox)        \n    ApplyTooltips (0)       \n    ApplyTooltips (1000)       \nEnd Sub       \n</code></pre>\n'}, {'answer_id': 73280329, 'author': 'SteveCinq', 'author_id': 5818981, 'author_profile': 'https://Stackoverflow.com/users/5818981', 'pm_score': 0, 'selected': False, 'text': '<p>After trying @Keithius\'s code and finding that the tip showed with mouse-over once the <code>OnClick</code> code had run, I ended up doing this:</p>\n<p>Button <code>Click</code> event:</p>\n<pre><code>ToolTip1.Show(&quot;Text to display&quot;, Control);\n</code></pre>\n<p>Button <code>MouseLeave</code> event:</p>\n<pre><code>ToolTip1.Hide(Control);\n</code></pre>\n<p>But then I found that if I specified a position - using either explicit <code>x</code> and <code>y</code> co-ords or a <code>Point</code>, it worked as expected:</p>\n<p>Button <code>Click</code> event:</p>\n<pre><code>ToolTip1.Show(&quot;Text to display&quot;, Control, Control.Width+20, 0, 2000);\n</code></pre>\n<p>or</p>\n<pre><code>ToolTip1.Show(&quot;Text to display&quot;, Control, new Point(Control.Width+20, 0), 2000);\n</code></pre>\n<p>This is possibly due to the modality of some overloads as mentioned in the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.tooltip.show" rel="nofollow noreferrer">Microsoft doco</a>.</p>\n'}]
['https://Stackoverflow.com/questions/63439', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2187/']