UCM Posted March 30, 2003 Posted March 30, 2003 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? Quote UCM >-)
*Experts* Volte Posted March 30, 2003 *Experts* Posted March 30, 2003 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. Quote
UCM Posted March 30, 2003 Author Posted March 30, 2003 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 :) Quote UCM >-)
*Experts* Volte Posted March 30, 2003 *Experts* Posted March 30, 2003 Like I said, you most likely can't. I doubt tooltips are actual objects, and therefore cannot be ownerdrawn. Quote
Guest mutant Posted March 30, 2003 Posted March 30, 2003 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 Quote
UCM Posted March 30, 2003 Author Posted March 30, 2003 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 ) Quote UCM >-)
UCM Posted March 31, 2003 Author Posted March 31, 2003 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! :Dcustomtooltipexample.zip Quote UCM >-)
Guest mutant Posted March 31, 2003 Posted March 31, 2003 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. Quote
wyrd Posted March 31, 2003 Posted March 31, 2003 Heh.. nice tip mutant. I like it. :) Quote Gamer extraordinaire. Programmer wannabe.
Guest mutant Posted March 31, 2003 Posted March 31, 2003 (edited) Hehe. Here is my version of a custom tooltip. [edit] Removed binaries - divil [/edit]windowsapplication2.zip Edited March 31, 2003 by divil Quote
UCM Posted March 31, 2003 Author Posted March 31, 2003 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... Quote UCM >-)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.