Function Reference


_GUICtrlEdit_CanUndo

Determines whether there are any actions in an edit control's undo queue

#include <GuiEdit.au3>
_GUICtrlEdit_CanUndo ( $hWnd )

Parameters

$hWnd Control ID/Handle to the control

Return Value

True: If there are actions in the control's undo queue.
False: If the undo queue is empty.

Remarks

If the undo queue is not empty, you can call the _GUICtrlEdit_Undo() to undo the most recent operation.

Related

_GUICtrlEdit_EmptyUndoBuffer, _GUICtrlEdit_GetModify, _GUICtrlEdit_SetModify, _GUICtrlEdit_Undo

Example

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

Example()

Func Example()
        Local $idEdit

        ; Create GUI
        GUICreate("Edit Can Undo", 400, 300)
        $idEdit = GUICtrlCreateEdit("This is a test" & @CRLF & "Another Line", 2, 2, 394, 268)
        GUISetState(@SW_SHOW)

        MsgBox($MB_SYSTEMMODAL, "Information", "Can Undo: " & _GUICtrlEdit_CanUndo($idEdit))

        _GUICtrlEdit_AppendText($idEdit, @CRLF & "Append to the end?")

        MsgBox($MB_SYSTEMMODAL, "Information", "Can Undo: " & _GUICtrlEdit_CanUndo($idEdit))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUIDelete()
EndFunc   ;==>Example