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

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

[复制链接]
发表于 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大家多多帮帮忙。。。。。。。谢谢
发表于 2008-12-2 08:56:08 | 显示全部楼层
不知道你想问什么.如果说是你贴出来的代码,那已经可以了
 楼主| 发表于 2008-12-2 09:16:00 | 显示全部楼层
自动判断1。TXT文件。。如果存在运行$Form1。。。。如果不存在运行$Form2。。
可是老实出错。。。不知道哪里错了。。。
发表于 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
发表于 2008-12-2 10:29:08 | 显示全部楼层
和双界面切换应该道理一样
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-23 10:28 , Processed in 0.073620 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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