qsy666888 发表于 2018-2-9 10:51:30

这个撤销怎么写哟,大侠们 已解决

本帖最后由 qsy666888 于 2018-2-10 16:38 编辑

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 238, 201, 314, 131)
GUICtrlCreateInput("454222545242", 40, 40, 121, 21)
$Button1 = GUICtrlCreateButton("←", 72, 112, 75, 25)
GUICtrlSetFont(-1, 25, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
               Case $Button1
EndSwitch
WEnd

austere 发表于 2018-2-9 13:16:45

回复 1# qsy666888


    是要撤销一行还是撤销一个字节?
一行的话直接设置为空就好了,如果是撤销一个字节,先读取数据,然后删掉一个字节,然后再设置上~

xzf680 发表于 2018-2-9 13:22:40

清空的话直接修改为空
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 238, 201, 314, 131)
$Input = GUICtrlCreateInput("454222545242", 40, 40, 121, 21)
$Button1 = GUICtrlCreateButton("←", 72, 112, 75, 25)
GUICtrlSetFont(-1, 25, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        GUICtrlSetData($Input, "")
        EndSwitch
WEnd

xzf680 发表于 2018-2-9 13:28:13

删除右起一个字节写法:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 238, 201, 314, 131)
$Input = GUICtrlCreateInput("454222545242", 40, 40, 121, 21)
$Button1 = GUICtrlCreateButton("←", 72, 112, 75, 25)
GUICtrlSetFont(-1, 25, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        Local $Read = GUICtrlRead($Input)
                        Local $sString = StringTrimRight($Read, 1) ; 删除字符串右起 1个字符.
                        GUICtrlSetData($Input, $sString)
        EndSwitch
WEnd

qsy666888 发表于 2018-2-9 14:41:03

回复 4# xzf680

谢谢大侠,平时没有怎么练,有的基本搞忘了

zjyy007 发表于 2018-2-14 11:52:29

xzf680正解,其实就是输入框内字符的增减而已
页: [1]
查看完整版本: 这个撤销怎么写哟,大侠们 已解决