Setzt den Rand, welcher verwendet wird, um den Text in einem Button-Control zu zeichnen
#Include <GuiButton.au3>
_GUICtrlButton_SetTextMargin($hWnd[, $iLeft = 1[, $iTop = 1[, $iRight = 1[, $iBottom = 1]]]])
Parameter
| $hWnd | Handle zu dem Control |
| $iLeft | [optional] Linker Rand um den Text zu zeichnen |
| $iTop | [optional] Oberer Rand um den Text zu zeichnen |
| $iRight | [optional] Rechter Rand um den Text zu zeichnen |
| $iBottom | [optional] Unterer Rand um den Text zu zeichnen |
Rückgabewert
| Erfolg: | True |
| Fehler: | False |
Bemerkungen
Mindestvoraussetzung Betriebssystem: Windows XP
Verwandte Funktionen
_GUICtrlButton_GetTextMargin
Siehe auch
Suche in der MSDN Bibliothek nach BCM_SETTEXTMARGIN
Beispiel
#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GUIConstantsEx.au3>
#include <GuiButton.au3>
#include <WindowsConstants.au3>
Opt("MustDeclareVars", 1)
Global $iMemo
_Main()
Func _Main()
Local $y = 70, $btn[6], $aMargins
GUICreate("Buttons", 510, 400)
$iMemo = GUICtrlCreateEdit("", 119, 10, 276, 374, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
$btn[0] = GUICtrlCreateButton("Button 1", 10, 10, 90, 50)
_GUICtrlButton_SetTextMargin($btn[0], 10, 5, 10, 5)
For $x = 1 To 5
$btn[$x] = GUICtrlCreateButton("Button " & $x + 1, 10, $y, 90, 50)
$y += 60
Next
For $x = 0 To 5
$aMargins = _GUICtrlButton_GetTextMargin($btn[$x])
MemoWrite("Button " & $x + 1 & " Ränder:" & @CRLF & @TAB & _
"Links.: " & $aMargins[0] & @TAB & "Oben...: " & $aMargins[1] & @CRLF & @TAB & _
"Rechts: " & $aMargins[2] & @TAB & "Unten..: " & $aMargins[3] & @CRLF)
Next
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Exit
EndFunc ;==>_Main
; Gibt eine Zeile im Memo-Fenster aus
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite