# Function Reference

# _GUICtrlButton_GetText

Retrieve the text of the button

#include <GuiButton.au3>
_GUICtrlButton_GetText ( $hWnd )

## Parameters

$hWnd | Control ID/Handle to the control

## Return Value

Success: | the text of the button.
Failure: | an empty string ""

## Related

_GUICtrlButton_SetText

## Example

    #include "Extras\HelpFileInternals.au3"

    #include <GuiButton.au3>
    #include <GUIConstantsEx.au3>
    #include <MsgBoxConstants.au3>

    Example()

    Func Example()
        Local $y = 70, $a_idBtn[6], $iRand

        GUICreate("Buttons", 510, 400)
        _MemoCreate(119, 10, 276, 374, 0)
        GUISetState(@SW_SHOW)

        $a_idBtn[0] = GUICtrlCreateButton("Button1", 10, 10, 90, 50)

        For $x = 1 To 5
            $a_idBtn[$x] = GUICtrlCreateButton("Button" & $x + 1, 10, $y, 90, 50)
            $y += 60
        Next

        $iRand = Random(0, 5, 1)
        MsgBox($MB_SYSTEMMODAL, "Information", "Setting Button" & $iRand + 1 & " Text")
        _GUICtrlButton_SetText($a_idBtn[$iRand], "New Text" & $iRand + 1)

        For $x = 0 To 5
            _MemoWrite("$a_idBtn[" & $x & "] Text: " & _GUICtrlButton_GetText($a_idBtn[$x]))
        Next

        While 1
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    ExitLoop
            EndSwitch
        WEnd

        Exit
    EndFunc   ;==>Example