Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mixing Fonts in Tool Tips

Status
Not open for further replies.

alan54

Chemical
Jun 20, 2001
23
Does anyone know a way to mix fonts in Tool tips.

For example, I have a label for "Area = ", and when the cursor hovers over label, I want Tool Tip to display formula, i.e. area of a circle: "Area = (pi)*r^2". But instead of writing "(pi)", I'd rather use the symbol for pi, i.e. the letter "p" using symbol font while other parts of the Tool Tip would be in Arial.

Extra credit: I'd like for the "2" to be "superscript" rather than "^2".
 
Replies continue below

Recommended for you

Try looking at Character Map. For Arial, code 178 is ² and 182 looks like ¶. Hopes this helpsl
 
Regg,

Thanks, that's a good idea & works with Arial. After looking at this approach, the Times Roman pi looks better but it seems the Tool Tips font is fixed (as Arial I suppose; several Fonts look similar & probably have same Chr numbers ???) because changing the label font has no effect on the Tool Tip font.

Many Thanks
 
The tool tips font is controlled by Windows I believe. Right click on your desktop [pc3]. Select Properties and then the Appearance tab. From the Item drop down, select Tool Tip. The font and font size is listed below. You should be able to change it to anything you like. Unfortunately, not everyone that may use your program will want to change fonts on their PC.

Regards,

Regg [smile]
 
Regg,

I'm impressed. Thanks much. Is there any way to change a Windows property from within a VB program, maybe an API call?

It seems that if not, you can't do much fancy with the other characters in a font (i.e. codes 178 & 182) because you just don't know which Tool Tip font they are using.

Your thoughts please.

Thanks,
Alan
 
Alan,

I imagine there is an API but I do not know what it is off hand. I have not done anything like that since Windows 3.1 (been out of programming for a few years). One thing you must remember. If you are planning on messing with other people's configurations, you better have your program inform the user of this change. I for one have a difficult time reading certain fonts. I have set mine (along with the font size)to those I can.

Seems to me I read a tip years ago on how to simulate a tool tip. I will page through my reference books when I get a chance and see if I can find it. Using that approach, you can set the font to one which will display ^2 and pi to your liking.

Regards,

Regg [smile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor