# Function Reference

# GUICtrlDelete

Deletes a control.

GUICtrlDelete ( controlID )

## Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate...() function, or -1 for the last created control.

## Return Value

Success: | 1.
Failure: | 0.

## Remarks

For context menu controls see GUICtrlCreateContextMenu() remarks.

## Related

GUICreate, GUICtrlCreate..., GUICtrlCreateContextMenu

## Example

    #include <GUIConstantsEx.au3>

    Example()

    Func Example()
        GUICreate("My GUI delete control", 200, 200, 800, 200)
        Local $idDate = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
        Local $idBtn_Del = GUICtrlCreateButton("Delete control", 50, 50, 70, 20)
        GUISetState(@SW_SHOW)

        Local $idMsg
        ; Loop until the user exits.
        Do
            $idMsg = GUIGetMsg()
            If $idMsg = $idBtn_Del Then
                GUICtrlDelete($idDate)
                GUICtrlDelete($idBtn_Del)
            EndIf
        Until $idMsg = $GUI_EVENT_CLOSE
    EndFunc   ;==>Example