user565739
user565739

Reputation: 1332

use fixed-width font for tooltip

I want to display some mouse event information in a tooltip. It looks like:

Win1 : x =  100; y =   99; dx =  655; dy = 1789;
Win2 : x = 2396; y =  133; dx =   78; dy =  111;
....
....

Even if I use %4d and other things to format the text, it doesn't give the perfect result as above. Is there any way to display data in the format as above in tooltip? I can only imagine that one can use fixed-width font, but I don't have any idea how to change font in tooltip.

Upvotes: 1

Views: 182

Answers (1)

Adrian McCarthy
Adrian McCarthy

Reputation: 47962

You need to get a handle to the tooltip window. Then you can send it a WM_SETFONT message with the handle to a fixed-width font.

Upvotes: 2

Related Questions