找回密码
 加入
搜索
查看: 1277|回复: 3

对于窗体的操作(很菜的问题)

[复制链接]
发表于 2009-2-10 09:46:41 | 显示全部楼层 |阅读模式
请问我有一个FORM1的窗体,上边上面有一个:”按扭“
单击这个按扭的时候显示一个新的窗体FORM2,然后FORM1禁用,在FORM2上编辑一些命令,完成后关闭FORM2(按右上角的小叉子),然后FORM1起用。请问该如何实现???
我自己做了一个,当关闭FORM2窗体的时候,FORM1也关闭了
请问是什么原因???
发表于 2009-2-10 09:57:09 | 显示全部楼层
用GUIDELETE关闭FORM2
 楼主| 发表于 2009-2-10 10:38:57 | 显示全部楼层
原帖由 cnsnc 于 2009-2-10 09:57 发表
用GUIDELETE关闭FORM2


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

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 294, 213, 192, 124)
$Button1 = GUICtrlCreateButton("更多...", 176, 136, 97, 57, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $Msg1 = GUIGetMsg()
        Switch $Msg1
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                                                $Form2 = GUICreate("Form2", 219, 213, 302, 218)
                        $Button1 = GUICtrlCreateButton("设置1", 72, 48, 75, 25, 0)
                        $Button2 = GUICtrlCreateButton("设置2", 72, 88, 75, 25, 0)
                        $Button3 = GUICtrlCreateButton("设置3", 72, 128, 75, 25, 0)
                        GUISetState(@SW_SHOW)
                                While 1
                                        $Msg2 = GUIGetMsg()
                                        Select
                                        Case $Msg2 =$GUI_EVENT_CLOSE
                                                Exit
                                        Case $Msg2 =$Button1
                                                ;
                                        Case $Msg2 =$Button2
                                                ;
                                        Case $Msg2 =$Button3
                        ;
        EndSelect
        GUISetState(@SW_ENABLE,$form1)
WEnd
        EndSwitch
WEnd
这是代码,帮忙看看吧
发表于 2009-2-10 12:49:11 | 显示全部楼层
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


$Form1 = GUICreate("Form1", 294, 213, 192, 124)
$Button1_1 = GUICtrlCreateButton("更多...", 176, 136, 97, 57, 0)

$Form2 = GUICreate("Form2", 219, 213, 302, 218)
$Button1_2 = GUICtrlCreateButton("设置1", 72, 48, 75, 25, 0)
$Button2_2 = GUICtrlCreateButton("设置2", 72, 88, 75, 25, 0)
$Button3_2 = GUICtrlCreateButton("设置3", 72, 128, 75, 25, 0)

GUISetState(@SW_SHOW,$Form1)
GUISetState(@SW_HIDE,$Form2)

While 1
        $Msg1 = GUIGetMsg()
        Switch $Msg1
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1_1
                        GUISetState(@SW_DISABLE,$Form1)
                        GUISetState(@SW_SHOW,$Form2)
                        While 2
                                $Msg2 = GUIGetMsg()
                                Select
                                        Case $Msg2 = $GUI_EVENT_CLOSE
                                                GUISetState(@SW_HIDE,$Form2)
                                                GUISetState(@SW_ENABLE,$Form1)
                                                WinActivate($Form1)
                                                ExitLoop
                                        Case $Msg2 = $Button1_2
                                                ;
                                        Case $Msg2 = $Button2_2
                                                ;
                                        Case $Msg2 = $Button3_2
                                                ;
                                EndSelect
                        WEnd
        EndSwitch
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-23 07:18 , Processed in 0.077942 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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