找回密码
 加入
搜索
查看: 1497|回复: 5

[AU3基础] 这个撤销怎么写哟,大侠们 已解决

[复制链接]
发表于 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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2018-2-9 13:16:45 | 显示全部楼层
回复 1# qsy666888


    是要撤销一行还是撤销一个字节?  
一行的话直接设置为空就好了,如果是撤销一个字节,先读取数据,然后删掉一个字节,然后再设置上~
发表于 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
发表于 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
 楼主| 发表于 2018-2-9 14:41:03 | 显示全部楼层
回复 4# xzf680

谢谢大侠,平时没有怎么练,有的基本搞忘了
发表于 2018-2-14 11:52:29 | 显示全部楼层
xzf680正解,其实就是输入框内字符的增减而已
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-28 09:21 , Processed in 0.079203 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表