找回密码
 加入
搜索
查看: 4384|回复: 6

[GUI管理] AU3调用按钮的问题。。 进来探讨一下!

  [复制链接]
发表于 2015-1-21 18:20:29 | 显示全部楼层 |阅读模式
AU3如何在点击按钮1 后 将按钮1内的代码执行完毕后。开始执行按钮2中的内容。。 以前我应该实现过。不过忘记是怎么调用的了。。 请老大指教一下!

使用FUCK 命令的请直接跳过。。
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 180, 181, 192, 114)
$Button1 = GUICtrlCreateButton("Button1", 16, 32, 129, 41)
$Button2 = GUICtrlCreateButton("Button2", 16, 96, 129, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        MsgBox(0,0,"我是按钮1!")
        Case $Button2                        
                        MsgBox(0,0,"我是按钮2,嘿嘿!")                        
        EndSwitch
WEnd
发表于 2015-1-21 18:57:29 | 显示全部楼层
http://www.autoitx.com/forum.php ... 8079&highlight=
搜索自己的帖子:<当我点击按钮1时。如何在执行完毕后自动执行按钮2中的内容?>
哈哈......
 楼主| 发表于 2015-1-21 20:38:36 | 显示全部楼层
回复 2# chzj589


    ....还是调用FUNCK 函数的。。
发表于 2015-1-21 21:18:36 | 显示全部楼层
回复 3# zhenglei
是这样吗?

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 180, 181, 192, 114)
$Button1 = GUICtrlCreateButton("Button1", 16, 32, 129, 41)
$Button2 = GUICtrlCreateButton("Button2", 16, 96, 129, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        MsgBox(0,0,"我是按钮1!")
                                                _Button2()
        Case $Button2                        
                        MsgBox(0,0,"我是按钮2,嘿嘿!")
                                                _Button1()
        EndSwitch
        WEnd
Func _Button1()
    MsgBox(0,0,"我是按钮1!",3)
EndFunc   ;==>_ea       
Func _Button2()
   MsgBox(0,0,"我是按钮2,嘿嘿!",3)
EndFunc   ;==>_ea
发表于 2015-1-22 04:33:48 | 显示全部楼层
把两个函数写到一起不就可以了吗
发表于 2015-1-30 09:02:30 | 显示全部楼层
有多种方法可以实现。
比如
1、在1的按钮里发送按钮2的消息
2、在判断消息=1或2,再在判断语句里再判断是否=1再看执不执行1
发表于 2015-2-4 01:02:43 | 显示全部楼层
探讨了一下人就不见了,人呢。不继续了吗?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-29 16:11 , Processed in 0.075342 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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