找回密码
 加入
搜索
查看: 3819|回复: 5

[GUI管理] 【已解决】热键启动GUI问题.

  [复制链接]
发表于 2010-9-22 22:28:49 | 显示全部楼层 |阅读模式
本帖最后由 qq82015930 于 2010-9-22 23:30 编辑

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $Paused
Dim $Form1
Dim $ok
HotKeySet("{F8}", "_123")  
HotKeySet("{PAUSE}", "_tc")   
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        _yc()

        EndSwitch
WEnd

Func _123()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 205, 99, 192, 114)
$Label1 = GUICtrlCreateLabel("号码:", 8, 16, 84, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput("500227198404211812", 80, 16, 121, 21)
$Button1 = GUICtrlCreateButton("OK", 8, 56, 75, 25)
$Button2 = GUICtrlCreateButton("KO", 112, 56, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $Button1

                     IF $ok = 0 Then
                      MsgBox(48, "提示", "没有发现!", 10)
               Else
                     _12()
                     _yc()       
               EndIf
                Case $Button2
                        _yc()                       
                Case $GUI_EVENT_CLOSE
                        _yc()

        EndSwitch
WEnd

EndFunc


Func _12()
;;;;
EndFunc

Func _yc()
        GUISetState(@SW_HIDE,$Form1);  隐藏 窗口
EndFunc

Func _tc()
        Exit
EndFunc





;F8  启动GUI  安几次就会启动几个GUI出来  如何让它只出现第一次按F8出的GUI ,在要显示必须是在执行 _yc()之后才能在用F8显示GUI  更正是_yc()

评分

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

查看全部评分

发表于 2010-9-22 22:53:57 | 显示全部楼层
加一行
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $Paused
Dim $Form1
Dim $ok

HotKeySet("{F8}", "_123")
HotKeySet("{PAUSE}", "_tc")
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        _yc()

        EndSwitch
WEnd

Func _123()
        HotKeySet("{F8}")
        #Region ### START Koda GUI section ### Form=
        $Form1 = GUICreate("Form1", 205, 99, 192, 114)
        $Label1 = GUICtrlCreateLabel("号码:", 8, 16, 84, 24)
        GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
        $Input1 = GUICtrlCreateInput("500227198404211812", 80, 16, 121, 21)
        $Button1 = GUICtrlCreateButton("OK", 8, 56, 75, 25)
        $Button2 = GUICtrlCreateButton("KO", 112, 56, 75, 25)
        GUISetState(@SW_SHOW)
        #EndRegion ### END Koda GUI section ###

        While 1
                $nMsg = GUIGetMsg()
                Switch $nMsg
                        Case $Button1

                                If $ok = 0 Then
                                        MsgBox(48, "提示", "没有发现!", 10)
                                Else
                                        _12()
                                        _yc()
                                EndIf
                        Case $Button2
                                _yc()
                        Case $GUI_EVENT_CLOSE
                                _yc()

                EndSwitch
        WEnd

EndFunc   ;==>_123


Func _12()
        ;;;;
EndFunc   ;==>_12

Func _yc()
        ;;;
EndFunc   ;==>_yc

Func _tc()
        Exit
EndFunc   ;==>_tc
 楼主| 发表于 2010-9-22 23:07:17 | 显示全部楼层
回复 2# lixiaolong


    、

谢谢,我Func _yc()
        GUISetState(@SW_HIDE,$Form1);  隐藏 窗口
EndFunc
是这样的,隐藏后不能在启动拉.
发表于 2010-9-22 23:20:03 | 显示全部楼层
回复 3# qq82015930

这样啊,那就再加一行
Func _yc()
GUISetState(@SW_HIDE,$Form1);  隐藏 窗口 
HotKeySet("{F8}", "_123")
EndFunc

评分

参与人数 1金钱 +10 收起 理由
qq82015930 + 10 谢谢~!

查看全部评分

 楼主| 发表于 2010-9-22 23:30:05 | 显示全部楼层
谢谢,解决~!!!
发表于 2010-9-23 02:16:10 | 显示全部楼层
好。。。。。。。。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-9 09:17 , Processed in 0.090299 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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