找回密码
 加入
搜索
查看: 2102|回复: 2

[AU3基础] 请教如何将EDIT框的内容写入文本?<已经解决>

[复制链接]
发表于 2011-5-23 13:10:37 | 显示全部楼层 |阅读模式
本帖最后由 木头人 于 2011-5-23 23:16 编辑

GUICtrlCreateEdit 框内的内容如果写入文本呢?
并且实现如果为手工一直输入的话,无须换行。
如果手工输入回车的话,再换行。
写入文本时如果有回车动作的则自动换行。
谢谢
发表于 2011-5-23 16:32:54 | 显示全部楼层
本帖最后由 papapa314 于 2011-5-23 16:36 编辑

回复 1# 木头人



#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 377, 299, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 64, 32, 241, 177)
$Button1 = GUICtrlCreateButton("Button1", 112, 240, 115, 33)
GUISetOnEvent($GUI_Event_CLose,"quit")
GUICtrlSetOnEvent($Button1,"write")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        Sleep(100)
WEnd

Func quit()
Exit
EndFunc


Func write()
                FileWrite("写入的文本.txt",GUICtrlRead($Edit1))
                MsgBox(0,"","写入成功",3)
EndFunc

评分

参与人数 1金钱 +20 收起 理由
木头人 + 20 谢谢,已经搞定

查看全部评分

发表于 2011-5-23 17:28:50 | 显示全部楼层
用guiread啊。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-21 11:01 , Processed in 0.084238 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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