UDF > GUI > GuiToolTip >


_GUIToolTip_UpdateTipText

D�finit le texte d'info-bulle pour un �l�ment d�clencheur donn�

#include <GuiToolTip.au3>
_GUIToolTip_UpdateTipText ( $hWnd, $hTool, $iID, $sText )

Param�tres

$hWnd Handle du contr�le info-bulle (retourn� par _GUIToolTip_Create.)
$hTool Handle de la fen�tre qui contient l'�l�ment, ou 0
$iID Identifiant de l'�l�ment, ou handle de fen�tre du contr�le auquel l'�l�ment est affect�
$sText Texte pour le contr�le info-bulle.

Valeur de retour

Aucune.

En relation

_GUIToolTip_GetText

Exemple

#include <GUIConstantsEx.au3>
#include <GUIToolTip.au3>

Example()

Func Example()
    Local $hGUI = GUICreate(StringTrimRight(@ScriptName, StringLen(".exe")), 350, 200)

    Local $idButton = GUICtrlCreateButton("Button", 30, 32, 130, 28)
    Local $hButton = GUICtrlGetHandle($idButton)

    ; Cr�e un contr�le info-bulle
    Local $hToolTip = _GUIToolTip_Create($hGUI)

    ; Ajoute un �l�ment au contr�le info-bulle
    _GUIToolTip_AddTool($hToolTip, 0, "Click this to change tooltip text", $hButton)
    GUISetState(@SW_SHOW)
    Local $bNew = False, $iMsg = GUIGetMsg()
 
    While $iMsg <> $GUI_EVENT_CLOSE 
        If $iMsg = $idButton Then
            ; Pressez le bouton pour changer le texte du tooltip
                $bNew = Not $bNew
                If $bNew Then
                    _GUIToolTip_UpdateTipText($hToolTip, 0, $hButton, 'Nouveau texte')
                Else
                    _GUIToolTip_UpdateTipText($hToolTip, 0, $hButton, "Cliquez ici pour changer le texte du tooltip")
                EndIf
        EndIf
        $iMsg = GUIGetMsg()
    WEnd

    ; D�truit le contr�le info-bulle
    _GUIToolTip_Destroy($hToolTip)
    GUIDelete($hGUI)
EndFunc   ;==>Example