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

[GUI管理] GUI怎么写按钮被选中以后将这个信息传抵给执行按钮呢(已经解决)

  [复制链接]
发表于 2011-12-16 16:47:27 | 显示全部楼层 |阅读模式
本帖最后由 asura 于 2011-12-19 14:55 编辑

具体代码如下:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 304, 182, 192, 114)
$Button1 = GUICtrlCreateButton("EXCEL修复", 40, 32, 89, 33)
$Button2 = GUICtrlCreateButton("输入法安装", 172, 30, 89, 33)
$Button3 = GUICtrlCreateButton("取消", 175, 95, 89, 33)
$Button4 = GUICtrlCreateButton("执行", 40, 97, 89, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
我就想如果我按钮下 EXCEL修复 按钮(最好在能选中这个按钮时候有相关标记等)  怎么将这个信息传递给 执行这个按钮 然后 由它来启动相关操作,如果点击取消 ,则不执行 希望大虾能帮忙下,小弟在此谢谢各位了。
发表于 2011-12-16 20:54:36 | 显示全部楼层
本帖最后由 cxlater 于 2011-12-16 20:56 编辑

云里 、。。。雾里。。。。
直接调用button4的函数不就可以了吗
发表于 2011-12-16 22:11:25 | 显示全部楼层
本帖最后由 Ycxw2008 于 2011-12-19 12:01 编辑

发现好丢人
发表于 2011-12-16 22:11:47 | 显示全部楼层
感觉很简单的事被楼主想复杂了
发表于 2011-12-17 08:36:45 | 显示全部楼层
很明白楼主的迷惑,
也看出了楼主的要求,
其实, 楼主是想把 Button1 和 Button2 做成 Radio 的单选项功能,
用 GUICtrlCreateRadio 命令即可.
关于Radio选中与否的判断, 帮助里详细例子的.
希望您有耐心看一看.

评分

参与人数 1金钱 +10 收起 理由
3mile + 10 这个解释合理

查看全部评分

发表于 2011-12-17 08:41:11 | 显示全部楼层
本帖最后由 netegg 于 2011-12-17 08:47 编辑

[au3]global $info
...
switch $msg
  case $button1
     $info = 1
  case $button4
     dosth($info)
endswitch

func dosth($info = 0)
if not $info then return
msgbox(0,0,0)
endfunc[/au3]
 楼主| 发表于 2011-12-19 14:53:15 | 显示全部楼层
回复 5# user3000

谢谢这位兄弟,我想的就是这个意思,也感谢所有回帖的人,谢谢。本人菜鸟,还请各位大侠,多见谅
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-27 09:17 , Processed in 0.082835 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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