Définit le texte d'info-bulle pour un élément déclencheur donné
#include <GuiToolTip.au3>
_GUIToolTip_UpdateTipText ( $hWnd, $hTool, $iID, $sText )
$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. |
#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