函数参考


_GUICtrlEdit_CanUndo

确定在编辑控件的撤销队列中是否还有操作

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

参数

$hWnd 控件的控件ID/句柄

返回值

True:控件的撤消队列有操作返回
False:撤消队列为空

注意/说明

 如果撤消队列不空,可以调用 _GUICtrlEdit_Undo 撤消最近的操作.

相关

_GUICtrlEdit_EmptyUndoBuffer, _GUICtrlEdit_GetModify, _GUICtrlEdit_SetModify, _GUICtrlEdit_Undo

示例/演示


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

$Debug_Ed = False ; Check ClassName being passed to Edit functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
    Local $hEdit

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

    MsgBox(4160, "信息", "Can Undo: " & _GUICtrlEdit_CanUndo($hEdit))

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

    MsgBox(4160, "信息", "Can Undo: " & _GUICtrlEdit_CanUndo($hEdit))

    ; 循环直到用户退出
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main