Fancy Tooltips and .visible=false

G

google-post

I am trying to implement the fancy tooltips from Stephen Leban's site,
and am having a small problem with controls that are not always
visible.

Initially I simply set the tooltip to an empty string, but that means I
need to reset the tooltip every time the visible status of a control is
changed in code.

Is it possible to "catch" the tooltip before it is displayed so that I
could handle this in one location (instead of having to change all
instance of ctl.visible=TRUE or ctl.visible=FALSE to a function that
would also set/reset the tooltip)?

The only other problem I am having with the tooltips is that sometimes
I will get multiple tooltips on-screen if I move the mouse slowly
between controls that don't have an intervening control with
onmousemove 'hidetooltips'. Any easy solution to that problem?

Thanks,
John
http://www.mp3-boss.com
 
S

Stephen Lebans

There is a TTN_SHOW Notification message that is sent to the owner window
prior to displaying the ToolTip. You would have to subclass the Access form
which is generally not a good idea in Access land due to a bug. If you
decide to subclass then place your subclassing code in an externall DLL and
you will avoid the bug.

For your second issue simply remove any chance of overlap for the ToolTip
window regions. For adjacent controls simply reduce the height and width
calculated in the relevant section of the ToolTips class.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
G

google-post

Stephen,

I think I'll just add a function to set/reset the tooltips when the
control changes visible status, and added a line:
If ctl.Properties("visible") = False Then ti.lpszText = ""
to Sub SetToolText in clsToolTip

I added a +/-1 offset to the size of the bounding rectangle in Function
AddTool, and it does seem to help the adjacent controls problem.

Over time, I've found that the normal controltips (Access97) just don't
show reliably. I know some of the problem is the placement of controls
that might not always be topmost, but other times I just find that the
normal controltips would require more than 30seconds to show. Your
routine gives me much better consistency for pop-up time (and let me
set the pop-up time reliably).

Thanks for your help! I really appreciate all the time you take to
help out the Access development community.

John
http://www.mp3-boss.com
 

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

Top