Funktionreferenz


_GUIToolTip_GetMaxTipWidth

Beschreibung anzeigen in

Ermittelt die maximale Breite eines ToolTip Fensters

#include <GuiToolTip.au3>
_GUIToolTip_GetMaxTipWidth ( $hWnd )

Parameter

$hWnd Handle des Controls (welches von _GUIToolTip_Create zurückgegeben wird.)

Rückgabewert

Erfolg: Gibt die maximale ToolTip Breite in Pixel zurück
Fehler: -1.

Bemerkungen

Der maximale ToolTip Wert zeigt nicht die aktuelle ToolTip Breite an.
Vielmehr bricht das Control den Text mit Leerzeichen in mehrere Zeilen um wenn der ToolTip String die maximale Breite erreicht hat.
Falls der Text nicht in mehrere Zeilen unterteilt werden kann, wird er in einer einzelnen Zeile dargestellt.
Die Länge dieser Zeile könnte die maximale ToolTip Breite überschreiten.

- - - - - - - - Erklärung der Controls - - - - - - - -

Verwandte Funktionen

_GUIToolTip_SetMaxTipWidth

Beispiel

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

Example()

Func Example()
    Local $hGUI = GUICreate("ToolTip Get/Set Max TipWidth (v" & @AutoItVersion & ")", 350, 200)

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

    ; Create a ToolTip control
    Local $hToolTip = _GUIToolTip_Create($hGUI)
    ; Set the maximum width to 400 pixels
    _GUIToolTip_SetMaxTipWidth($hToolTip, 400)
    ; Add a multi-line tool to the ToolTip control using @CRLF to break the text into 2 lines
    _GUIToolTip_AddTool($hToolTip, 0, 'If the text exceeds the width, then it carries over to the next line.' & @CRLF & 'Also allows you to use @CRLF', $hButton)
    ; Add a multi-line tool to the ToolTip control using the MaxTipWidth setting to break the text into 2 lines.
    _GUIToolTip_AddTool($hToolTip, 0, 'If the text exceeds the width, then it carries over to the next line. Also allows you to use @CRLF', $hGUI)
    GUISetState(@SW_SHOW)

    While 1
        If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    ; Destroy the ToolTip control
    _GUIToolTip_Destroy($hToolTip)
    GUIDelete($hGUI)
EndFunc   ;==>Example