Sign in to follow this  
Followers 0
greensky

How many pixels text is going to take?

4 posts in this topic

How can I know how much screen space a ToolTip with some text is going to take?

I'd like to be able to position a ToolTip in the upper-right corner of the screen... without the ToolTip going off the screen, of course.

Is there any Windows API function for calculating this (given the text and font name, size, etc.)?

I'd really appreciate any help with this... Thanks!

Share this post


Link to post
Share on other sites



maybe this

#include <GUIConstants.au3>

$tip_info = "tip information now displaying"
$pos = StringLen($tip_info)
ToolTip($tip_info,@DesktopWidth - ($pos * 5), 0)

While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    ;Case $msg = $GUI_Button
        
        
    EndSelect
    
Wend

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

$ToolTipText = "This is a Tooltip in the upper" & @LF & "right corner"
ToolTip($ToolTipText, @DesktopWidth, 0)
$pos = WinGetPos($ToolTipText)
WinMove($ToolTipText, "", @DesktopWidth - $pos[2], 0)
Sleep(2000); Sleep to give tooltip time to display


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Humm... Those will work!

That one using WinGetPos... very ingenious!

Thank you! :P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0