Fügt ein Standardicon und ein Titelstring hinzu
#include <GuiToolTip.au3>
_GUIToolTip_SetTitle ( $hWnd, $sTitle [, $iIcon = 0] )
$hWnd | Handle des Controls (welches von _GUIToolTip_Create zurückgegeben wird.) |
$sTitle | Titelstring |
$iIcon | [optional] Setzt einen der unteren Werte: $TTI_NONE (0) - Kein Icon [Standard] $TTI_INFO (1) - Informationsicon $TTI_WARNING (2) - Warnungsicon $TTI_ERROR (3) - Erroricon $TTI_INFO_LARGE (4) - Großes Informationsicon $TTI_WARNING_LARGE (5) - Großes Warnungsicon $TTI_ERROR_LARGE (6) - Großes Erroricon |
Erfolg: | True. |
Fehler: | False. |
Bei Windows XP SP2 und neuer, kann $iIcon einen HICON Wert enthalten. Jeder Wert größer als 3 wird als HICON angesehen.
Der Titel eines Tooltips taucht in einer anderen Schriftart über dem Text des Tooltips auf.
Es reicht nicht nur den Titel eines Tooltips anzugeben, da ein Tooltip nur angezeigt wird wenn ein Titel und Text angegeben wird.
Ein Titel mit einem Icon aber ohne Text im Titel wird weder Titel noch Icon anzeigen.
Selbst wenn man nur ein Icon anzeigen möchte, so muss man dennoch mindestens einen Buchstaben angeben.
Der String der in $sTitle enthalten ist darf nicht länger als 99 Zeichen sein.
- - - - - - - - Erklärung der Controls - - - - - - - -
_GUIToolTip_GetTitleText, _GUIToolTip_UpdateTipText
#include <GUIConstantsEx.au3>
#include <GUIToolTip.au3>
Example()
Func Example()
Local $hGUI = GUICreate(StringTrimRight(@ScriptName, StringLen(".exe")), 350, 200)
Local $idAdd = GUICtrlCreateButton("Button", 30, 32, 130, 28)
Local $hAdd = GUICtrlGetHandle($idAdd)
; Create a tooltip control
Local $hToolTip = _GUIToolTip_Create($hGUI)
; Add a tool to the tooltip control
_GUIToolTip_AddTool($hToolTip, 0, "This is the ToolTip text", $hAdd)
; Set the title of the tooltip
_GUIToolTip_SetTitle($hToolTip, 'This is the ToolTip title', $TTI_INFO)
GUISetState(@SW_SHOW)
While 1
If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
; Destroy the tooltip control
_GUIToolTip_Destroy($hToolTip)
GUIDelete($hGUI)
EndFunc ;==>Example