找回密码
 加入
搜索
查看: 2844|回复: 8

[AU3基础] 父窗口如何当条件触发时向子窗口listbox中添加项目

  [复制链接]
发表于 2013-2-19 11:04:42 | 显示全部楼层 |阅读模式
本帖最后由 oceanwind 于 2013-2-19 11:07 编辑

父窗口如何当条件触发时向子窗口listbox中添加项目
当打开子窗口时 父窗口无法操作
谢谢先
发表于 2013-2-19 11:38:02 | 显示全部楼层
guigetmsg(1)使用高级模式,父子窗口共用事件信息。。

评分

参与人数 1金钱 +10 收起 理由
oceanwind + 10 谢谢

查看全部评分

 楼主| 发表于 2013-2-19 13:55:43 | 显示全部楼层
guigetmsg(1)使用高级模式,父子窗口共用事件信息。。
funco 发表于 2013-2-19 11:38

帮我看看怎样才能在主窗口脚本不停的情况下进行:  GUICtrlSetData($his_list,$si)
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form = GUICreate("Form1", 429, 155, 192, 124)
$Button_icon_his = GUICtrlCreateButton("Button1", 216, 48, 137, 41)
Global $si
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button_icon_his
                         _icon_list_show()

            EndSwitch       
       
            _main()
            
WEnd
Func _main()
        $si += 1
        If Mod($si,5) = 0 Then
                GUICtrlSetData($his_list,$si)
        EndIf       
       
EndFunc       
Func _icon_list_show()
    $Form1 = GUICreate("his", 90, 760, 1050, 24)
    $his_list = GUICtrlCreateList("icon his", 1, 1, 87, 759)
    GUICtrlSetLimit(-1, 200) ; 限制水平滚动
    GUISetState(@SW_SHOW)
    $show_list= True
    While $show_list
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        GUIDelete($Form1)
                        $show_list=False

        EndSwitch
    WEnd
EndFunc



谢谢先
 楼主| 发表于 2013-2-19 16:30:11 | 显示全部楼层
好象要用到_CoProc()  
不晓得这个方向对不对
发表于 2013-2-19 23:12:33 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form = GUICreate("Form1", 429, 155, 192, 124)
$Button_icon_his = GUICtrlCreateButton("Button1", 216, 48, 137, 41)
Global $si, $his_list
GUISetState(@SW_SHOW)

$Form1 = GUICreate("his", 90, 760, 1050, 24)
$his_list = GUICtrlCreateList("icon his", 1, 1, 87, 759)
GUICtrlSetLimit(-1, 200) ; 限制水平滚动
GUISetState(@SW_SHOW)
GUISwitch($Form)
While 1

        $nMsg = GUIGetMsg(1)
        Switch $nMsg[0]
                Case $nMsg[0] = $GUI_EVENT_CLOSE
                        If $nMsg[1] = $Form Then
                                MsgBox(0, "提示", "主窗口关闭")
                                Exit
                        ElseIf $nMsg[1] = $Form1 Then
                                MsgBox(0, "提示", "子窗口关闭")
                                GUIDelete($Form1)
                        EndIf
                       
                       
                Case $nMsg[0] = $Button_icon_his
                        _main()
        EndSwitch



WEnd
Func _main()
        $si += 1
        If Mod($si, 5) = 0 Then
                GUICtrlSetData($his_list, $si)
        EndIf

EndFunc   ;==>_main

评分

参与人数 1金钱 +10 收起 理由
oceanwind + 10 谢谢

查看全部评分

发表于 2013-2-19 23:12:54 | 显示全部楼层
不知道是不是你想要的~~

评分

参与人数 1金钱 +10 收起 理由
oceanwind + 10 谢谢

查看全部评分

 楼主| 发表于 2013-2-20 10:06:02 | 显示全部楼层
不知道是不是你想要的~~
funco 发表于 2013-2-19 23:12

我是想每循环调用一次 _main()
就自动guictrlsetdata一次。。。
不晓得这样可行不
发表于 2013-2-20 10:18:02 | 显示全部楼层
调用main不需要触发条件吗?我写的触发条件是点击按钮。而且从你提供的代码来看也不会终止。那样会陷入死循环。
 楼主| 发表于 2013-2-20 11:06:41 | 显示全部楼层
调用main不需要触发条件吗?我写的触发条件是点击按钮。而且从你提供的代码来看也不会终止。那样会陷入死循 ...
funco 发表于 2013-2-20 10:18

谢谢你的回复
不过那样的死循环是我需要的
有办法么
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 03:32 , Processed in 0.084702 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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