找回密码
 加入
搜索
查看: 4433|回复: 16

[AU3基础] GUI界面中,将Edit1多行文本保存进INI中,再从INI中读取文本显示在Edit2内

 火.. [复制链接]
发表于 2013-11-19 16:03:36 | 显示全部楼层 |阅读模式
Edit2要一次性将Edit1中的所有内容都显示出来。
请各路大虾支招。。。

本帖子中包含更多资源

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

×
发表于 2013-11-19 17:24:34 | 显示全部楼层
看看帮助手册IniRead 和 IniWrite...
发表于 2013-11-19 17:43:06 | 显示全部楼层
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 24, 24, 121, 249)
GUICtrlSetData(-1, "")
$Edit2 = GUICtrlCreateEdit("", 368, 16, 121, 257)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("Button1", 208, 64, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $a = GUICtrlRead($Edit1)
                        GUICtrlSetData($Edit2,$a)
        EndSwitch
WEnd
 楼主| 发表于 2013-11-19 19:52:16 | 显示全部楼层
楼上大虾,你的方法我也清楚,但不是我要的效果,
我需要先将Edit1多行文本保存进INI中===》再从INI中读取文本显示在Edit2内
====》简单说,Edit2显示的内容是从ini文件中读出来的==》而且要求这些内容是多行文本。
 楼主| 发表于 2013-11-19 19:56:10 | 显示全部楼层
IniRead 只能读出INI文件中单行文本,
我要求读出来的数据是多行文本,所以iniread是行不通的。
IniWrite...
发表于 2013-11-19 21:35:19 | 显示全部楼层
将Edit1多行文本保存进TXT中,再从TXT中读取文本显示在Edit2内,就可多行文本
发表于 2013-11-19 21:44:01 | 显示全部楼层
GUICtrlSetData($Edit2, GUICtrlRead($Edit1))
 楼主| 发表于 2013-11-19 21:55:42 | 显示全部楼层
haijie1223,
谢谢你的回复,
这个做法我也清楚的,
我是想把Edit1的多行信息先保存到文件中,以后每次打开软件时都可将信息读出来并显示在Edit2中,
请再指教。。
发表于 2013-11-19 22:00:12 | 显示全部楼层
回复 8# freewaybsq


    每次都保存?每次都读取?
发表于 2013-11-19 22:17:10 | 显示全部楼层
本帖最后由 Ycxw2008 于 2013-11-19 22:18 编辑
        IniWrite("test.ini", "TEST", "test1", "a|b|c|d")
        Local $sRead = StringReplace(IniRead("test.ini", "TEST", "test1",''),'|',@CRLF)
        MsgBox(0, '', $sRead)
        FileDelete('test.ini')
方法太多了,要学会变通
发表于 2013-11-20 00:22:09 | 显示全部楼层
楼上Ycxw2008 已经给出方法了
发表于 2013-11-20 14:42:36 | 显示全部楼层
干嘛要用INI啊,直接保存到txt本人中,然后打开的时候在读取txt就好了。
发表于 2013-11-22 20:30:47 | 显示全部楼层
9楼一句就搞定了,别纠结了
 楼主| 发表于 2013-11-23 08:41:42 | 显示全部楼层
感谢10楼,问题解决啦。。。
发表于 2013-11-25 15:55:02 | 显示全部楼层
102513

99990223
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-20 08:51 , Processed in 0.080750 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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