找回密码
 加入
搜索
查看: 2662|回复: 15

从列表框中读取多个信息并传递的问题

[复制链接]
发表于 2009-7-14 08:06:14 | 显示全部楼层 |阅读模式
本帖最后由 卫和谐 于 2009-7-18 07:11 编辑

组合框中的消息,是从别的控件读取的,在点击后如何传递给输入框/列表框,传递到输入框/列表框的多个消息怎么读取?
正在做一个软件,需要这样的功能,请帮下忙!
发表于 2009-7-14 09:59:00 | 显示全部楼层
[AU3]#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 455, 209, 193, 125)
$Combo1 = GUICtrlCreateCombo("1", 96, 40, 145, 25)
GUICtrlSetData(-1,"1|2|3|4")
$Input1 = GUICtrlCreateInput("Input1", 96, 96, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                CASE $Combo1
                        GUICtrlSetData($Input1,GUICtrlRead($Combo1))
        EndSwitch
WEnd[/AU3]
 楼主| 发表于 2009-7-14 20:45:50 | 显示全部楼层
非常感谢大绯狼 ,但我还想知道点击多个是怎样传递的,并显示在输入框架中!
发表于 2009-7-14 21:33:20 | 显示全部楼层
Combo能选择多个?!
 楼主| 发表于 2009-7-15 18:00:35 | 显示全部楼层
我说的是例如将Combo中的文件列表通过逐个点击传递给列表框,在列表框中显示出来!
 楼主| 发表于 2009-7-16 19:21:19 | 显示全部楼层
自己再顶一下,请帮忙!
发表于 2009-7-16 19:35:22 | 显示全部楼层
将Combo中的文件列表通过逐个点击传递给列表框,在列表框中显示出来
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 215, 326, 189, 124)
$List1 = GUICtrlCreateList("", 24, 16, 161, 227)
$Combo1 = GUICtrlCreateCombo("", 24, 272, 161, 25)
GUICtrlSetData(-1, "item2|item3", "item3") 
GUISetState(@SW_SHOW)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Exit
        CASE $Combo1
         GUICtrlSetData($List1,GUICtrlRead($Combo1)&'|')
        EndSwitch
WEnd
 楼主| 发表于 2009-7-16 22:35:11 | 显示全部楼层
感谢lynfr8 ,上面的功能我已能够实现了,再怎样从列表框读取消息呢?
发表于 2009-7-16 23:09:09 | 显示全部楼层
GUICtrlRead
--------------------------------------------------------------------------------
读取指定控件的状态或相关数据.
GUICtrlRead ( 控件ID [, 高级] )
类型                                             值
组合框(Combo),列表框(List)          选中的项目
 楼主| 发表于 2009-7-17 17:41:31 | 显示全部楼层
选中的项目,不明白是怎么回事?
我想读取列表框中全部的项目?
发表于 2009-7-17 17:47:22 | 显示全部楼层
那用Listview的udf吧
很完善了
具体看帮助文件的例子
 楼主| 发表于 2009-7-17 18:17:36 | 显示全部楼层

象这样的从组合框中点击得到消息传递给列表框,再从列表框读取信息!

本帖子中包含更多资源

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

×
发表于 2009-7-17 19:04:27 | 显示全部楼层
 #include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
$Form = GUICreate("Listview控件读取演示ACN", 287, 246, 192, 124)
$ListView = GUICtrlCreateListView("", 32, 24, 225, 161)
$Column = _GUICtrlListView_AddColumn($ListView, '解压运行程序', 220)
$Combo = GUICtrlCreateCombo("", 32, 200, 225, 25)
GUICtrlSetData(-1,'1.exe|2.exe|3.exe')
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   for $i = 0 To _GUICtrlListView_GetItemCount($ListView) - 1
         MsgBox(4096, "", ' 读取信息:'&_GUICtrlListView_GetItemText($ListView, $i))
   Next
   Exit
  Case $Combo
   _GUICtrlListView_AddItem($ListView, GUICtrlRead($Combo))
EndSwitch
WEnd

本帖子中包含更多资源

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

×
 楼主| 发表于 2009-7-18 07:12:18 | 显示全部楼层
列表框实现不容易,找错方向了,应该是编辑框!!!
发表于 2012-4-21 21:59:41 | 显示全部楼层
编辑框和文本框怎么区分啊?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-30 13:26 , Processed in 0.089223 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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