木头 发表于 2008-12-2 04:27:02

自动判断语句。。。请指教。。

If FileExists("1.txt") Then
$Form1= GUICreate("Form2", 275, 125, 209, 148)
$Group2 = GUICtrlCreateGroup("", 0, 0, 273, 121)
$Button2 = GUICtrlCreateButton("对", 32, 24, 89, 41, 0)
$Button3 = GUICtrlCreateButton("错", 144, 24, 89, 41, 0)
$Label1 = GUICtrlCreateLabel("本工具仅局限内部交流请勿对外发布,谢谢合作", 16, 88, 247, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                        Case $GUI_EVENT_CLOSE
                        Exit
         Case $Button2
             MsgBox(64,"猪","你是对的")
                        Exit
               Case $Button3
                       MsgBox(64,"猪","是你的不对")
        EndSwitch
WEnd
Else
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form2= GUICreate("Form2", 275, 125, 209, 148)
$Group1 = GUICtrlCreateGroup("", 0, 0, 273, 121)
$Button4 = GUICtrlCreateButton("对", 32, 24, 89, 41, 0)
$Button5 = GUICtrlCreateButton("错", 144, 24, 89, 41, 0)
$Label1 = GUICtrlCreateLabel("本工具仅局限内部交流请勿对外发布,谢谢合作", 16, 88, 247, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Case $GUI_EVENT_CLOSE
                        Exit
         Case $Button4
             MsgBox(64,"猪","你是对的")
                        Exit
               Case $Button5
                       MsgBox(64,"猪","是你的不对")
        EndSwitch
WEnd
EndIf

木头 发表于 2008-12-2 04:28:28

不知道怎么写了。。刚接触AU3大家多多帮帮忙。。。。。。。谢谢

liongodmien 发表于 2008-12-2 08:56:08

不知道你想问什么.如果说是你贴出来的代码,那已经可以了

木头 发表于 2008-12-2 09:16:00

自动判断1。TXT文件。。如果存在运行$Form1。。。。如果不存在运行$Form2。。
可是老实出错。。。不知道哪里错了。。。

netegg 发表于 2008-12-2 10:26:39

$form1=guicreate()
$form2=guicreate()
while 1
   if fileexsit()then
   Guisetstate(@sw_show,$form1)
else
    Guisetstate(@Sw_show, $form2)
endif
wend

netegg 发表于 2008-12-2 10:29:08

和双界面切换应该道理一样
页: [1]
查看完整版本: 自动判断语句。。。请指教。。