这个撤销怎么写哟,大侠们 已解决
本帖最后由 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
回复 1# qsy666888
是要撤销一行还是撤销一个字节?
一行的话直接设置为空就好了,如果是撤销一个字节,先读取数据,然后删掉一个字节,然后再设置上~ 清空的话直接修改为空
#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
删除右起一个字节写法:
#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 回复 4# xzf680
谢谢大侠,平时没有怎么练,有的基本搞忘了 xzf680正解,其实就是输入框内字符的增减而已
页:
[1]