ToolTip - controlling duration of display

M

Mike Salter

Is there any way to control the tooltip of a control so that it doesn't
disappear so quickly? I know there are tooltip controls available, but I am
creating controls on the fly, and adding tooltip text to them from a db.

TIA
 
G

Guest

Mike,

You need to use the SendMessage API using the TTM_SETDELAYTIME constant.

See
http://msdn.microsoft.com/library/d...ommctls/tooltip/messages/ttm_setdelaytime.asp for more details.

The corresponding code in C# is:

[DllImport("user32.dll", EntryPoint="SendMessageA", SetLastError=true)]
private static extern int SendMessageDelay(IntPtr hWnd, int message, int
wParam, int lParam);

SendMessageDelay( YourToolTipHandle, TTM_SETDELAYTIME, TTDT_AUTOPOP, 32767 );

Constants
private const int WM_USER = 0x0400;
private const int TTM_SETDELAYTIME = (WM_USER + 3);
private const int TTDT_AUTOPOP = 2;

Note the 32767 is the delay in milliseconds and is the maximum allowable
given the datatype - but 32.767 seconds should be enough!

Hope this helps.

Ian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top