找回密码
 加入
搜索
查看: 5180|回复: 10

[AU3基础] 如何 获取多个 Input 输入中的 信息 (Input由FOR创建)[已解决]

  [复制链接]
发表于 2012-4-7 16:23:29 | 显示全部楼层 |阅读模式
本帖最后由 魔导 于 2012-4-7 16:43 编辑

小弟想要把 FOR 创建的  Input 中的数字写进  *.ini  文件里去,
请各位前辈指点指点......感激不尽
试过多次之后要么出错要么就之读得最后一个  Input 的数字, 写 *.in i的时候都写成一样了  
代码是这样的
Local $wuping[17] = ['01','sad','qw11','00','15tr8','1155','fgh545','125tt','1225y','yu45','125tty','125yy5','1258yyu','236ty','1255yty','125rt','fg125']
Local $var = IniReadSection("F:\测试\价目.ini", "2012-04-07")
GUICreate("调控器",300,600)
$input = GUICtrlCreateInput("",0,2,80,15)
$mi = GUICtrlRead($input)
$button = GUICtrlCreateButton("查询",120,0,30,20)
$button1 = GUICtrlCreateButton("写入",80,0,30,20)
For $i = 0 to 16
GUICtrlCreateLabel($wuping[$i],0,30+30*$i)
GUICtrlCreateInput("",80,30+30*$i,30,15)
Next
GUISetState()
While 1
        $msg = GUIGetMsg()
        Switch $msg 
                Case -3
                        Exit
                Case $button
                        For $i = 0 To 16
                        GUICtrlCreateLabel($var[$i][1],130,30*$i)
                Next
        Case $button1
;~ 这段该怎么写??
        EndSwitch

WEnd

本帖子中包含更多资源

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

×

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

 楼主| 发表于 2012-4-7 16:45:57 | 显示全部楼层
不好意思给各位添麻烦啦。
在论坛找到P版的码了
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 261, 800, 192, 124)
Local $Input[10], $aInputs[10], $str
For $i = 0 To UBound($Input) - 1
        $Input[$i] = GUICtrlCreateInput("", 8, 8 + $i * 32, 121, 21)
                $aInputs[$i] = GUICtrlRead($Input[$i])
Next
$Button1 = GUICtrlCreateButton("保存", 152, 16, 75, 25)
$Button2 = GUICtrlCreateButton("显示", 152, 56, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        For $i = 0 To UBound($Input) - 1
                                        $aInputs[$i] = GUICtrlRead($Input[$i])
                        Next
                        MsgBox(0, 0, "保存完成")
                Case $Button2
                        $str = ""
                        For $i = 0 To UBound($Input) - 1
                                $str &= "Input" & $i + 1 & "的内容为:" & $aInputs[$i] & @CRLF
                        Next
                        MsgBox(0, 0, $str)
        EndSwitch
WEnd
发表于 2012-4-7 16:49:21 | 显示全部楼层
哈哈, 我早几月时跟你一样, 对批量处理控件时的数组运用是迷迷糊糊的.
多自己动手, 多思考, 多参考, 就会越来越熟练了!
 楼主| 发表于 2012-4-7 16:54:13 | 显示全部楼层
哈哈, 我早几月时跟你一样, 对批量处理控件时的数组运用是迷迷糊糊的.
多自己动手, 多思考, 多参考, 就会越 ...
user3000 发表于 2012-4-7 16:49



    谢谢前辈指点,小弟确实很模糊。有时弄得头都晕啦还想不出来,结果睡一觉起来有想出来了。
呵呵,对自己的思路都有些怀疑,它是不是在玩我
发表于 2012-4-7 21:06:10 | 显示全部楼层
恭喜楼主自己解决问题!
发表于 2012-4-7 23:40:52 | 显示全部楼层
肥猫还需多加练习~ 尤其 Gui 的布局(控件大小及坐标)需加强~
发表于 2012-4-8 06:39:34 | 显示全部楼层
GUI画得不是很好看,改良改良吧
 楼主| 发表于 2012-4-8 14:06:21 | 显示全部楼层
回复 5# xms77


    谢谢前辈支持,其实是论坛里面有大大们的码
 楼主| 发表于 2012-4-8 14:07:53 | 显示全部楼层
肥猫还需多加练习~ 尤其 Gui 的布局(控件大小及坐标)需加强~
afan 发表于 2012-4-7 23:40



    谢谢A大指教,小弟也觉得确实是太衰了。GUI开起来后很对不起观众....
 楼主| 发表于 2012-4-8 14:08:38 | 显示全部楼层
回复 7# pp648852


    谢谢前辈,正在正在努力中
发表于 2013-7-29 11:32:42 | 显示全部楼层
哈哈刚好要用到这段代码,谢谢啦
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 23:24 , Processed in 0.102473 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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