Any ideas on how to change tooltip colors & font

UCM

Centurion
Joined
Jan 1, 2003
Messages
135
Location
Colorado, usa
I assume we would probably ned to do some sort of ownerdraw form of a tooltip in order to change the background color, fore color, and the font...

Any idea on where to start?
 
I highly doubt that Tooltips are any real physical object that have
handles and DCs and whatnot. They are more than likely just drawn
on the screen. Unless you draw your own tooltips on the screen's
DC like that, I don't think you can change the existing ones.
 
hmmm, theres an idea...

One idea would be to create a form and use it as a tooltip no problem, but it wouldn't be a real tooltip...

How would I create an ownerdrawn or DC tooltip? Any example code would help a great deal :)
 
Like I said, you most likely can't. I doubt tooltips are actual objects,
and therefore cannot be ownerdrawn.
 
You can poorly( :) ) imitate the tooltip.

Thats how I would do it: Create a bitmap with the text you want to show, put a picturebox and make it invisible. On the mousemove event of a control set the apporopriate image to the picture box, get the location of the control, subtract or add the values from its location and then set the modified location to the picturebox so it doesnt go over the control, make the picturebox visible. On mouseleave event make the picture box invisible.

This is a very poor imitation of a tooltip :D
 
Lol! thanx guys, I got a pretty good idea on where to start now :)


I'll try to remember to knock up an example of something like that and post it up here ( poor or not, lol )
 
Here's a little example of a customized tool tip ( not exactly a tooltip, but it serves the purpose and allows for many appearance altering abilities...

As you can see of course, there are a few things up with it...

one of which is a timing effect ( we can worry bout that later )...

another is the amount of text that is displayed isn't much before it stops displaying the rest of the text...

Guys, feel free to play around with it, if you make any modifications, please post them here, thanx! :D
 

Attachments

Cool ToolTip, just add the museleave event so it hides and its all set. But one of the problems is that main form looses focus when the tooltip is shown.
 
nice one, mutant...

Images do provide a sweet appearence of tooltips...

I find text-only can be just as useful if we can work out the size of it ( make it autoscale it's size to accomidate any length of text )

This'll be fun to work on for a while ;)

One thing I'll need to do is use Divil's example of not loosing focus from one of the other threads in this forum...

and of course, make a mouse_leave event thingy among other things too...

All suggestions and comments are welcome...
 
Back
Top