Jump to content

Recommended Posts

Posted

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!

Posted

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

Posted

$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.

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...