Jump to content
Sign in to follow this  
Rishav

How to show a baloon tooltip

Recommended Posts

Rishav

Hi folks

I have created a UI which has some buttons. I would love to have some balloon tooltips popup when the cursor is placed over that buttons for a sec.

so far i haven't been able to do that.

any help?

regards

Rishav

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#Include <GuiToolTip.au3>

Opt('MustDeclareVars', 1)


Local $button1, $buttonclose, $Main, $htool

$Main=GUICreate("test", 240, 180)
$button1 = GUICtrlCreateButton("1", 0, 0, 40, 40, $BS_ICON)
GUICtrlSetImage(-1, "shell32.dll", 5)

$htool=_GUIToolTip_Create($Main, $TTS_BALLOON )
_GUIToolTip_SetToolInfo($Main, "Fire all the damned missiles!")
_GUIToolTip_Activate($htool,True)

GUISetState()

; Run the GUI until the dialog is closed
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $button1
            ExitLoop

    EndSwitch
WEnd

GUIDelete()
Exit
Edited by Rishav

Share this post


Link to post
Share on other sites
enaiman

Why are you trying to re-invent the wheel?

Read about GUICtrlSetTip

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

Opt('MustDeclareVars', 1)


Local $button1, $buttonclose, $Main, $htool

$Main=GUICreate("test", 240, 180)
$button1 = GUICtrlCreateButton("1", 0, 0, 40, 40, $BS_ICON)
GUICtrlSetTip(-1, "Fire all the damned missiles!", "", 0, 1)
GUICtrlSetImage(-1, "shell32.dll", 5)

GUISetState()

; Run the GUI until the dialog is closed
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $button1
            ExitLoop

    EndSwitch
WEnd

GUIDelete()
Exit

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
Rishav

eh? wasn't trying to invent the wheel. searching for tooltips in the help file i got the UDFs, and due to a lack of examples i simply had no idea how to proceed. i was going with trial and error without much success.

anyway thanks a lot.this is exactly what I wanted.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.