找回密码
 加入
搜索
查看: 17674|回复: 20

[交流] AU3如何在一个窗体中嵌入另一个窗体!

 火... [复制链接]
发表于 2010-10-2 03:01:49 | 显示全部楼层 |阅读模式
AU3如何在一个窗体中嵌入另一个窗体!希望高手能指点!小弟感激不尽!
发表于 2010-10-2 10:17:47 | 显示全部楼层
回复 1# 19377708
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $Form2, $Button2
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE,"Form1_event")
$Button1 = GUICtrlCreateButton("打开窗体", 258, 218, 75, 25)
GUICtrlSetOnEvent(-1, "Form1_event")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
Sleep(10)
WEnd
Func form2()
        $Form2 = GUICreate("Form2", 482, 300, -1, -1,  BitOR($WS_MINIMIZEBOX, $WS_DLGFRAME, $WS_CLIPSIBLINGS), BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $Form1)
        $img = GUICtrlCreatePic("W_title_r1_c1.gif", 0, 0, 1, 1)
;上面那个图片不加上就不行,不知道为什么......你自己随便找个图片就行,图片我就不上传了
        $Button2 = GUICtrlCreateButton("关闭此窗体", 190, 122, 103, 25)
        GUICtrlSetOnEvent(-1, "Form2_event")
        GUISetState(@SW_SHOW)
EndFunc   ;==>form2
Func Form1_event()
        Switch @GUI_CtrlId
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        form2()
        EndSwitch
EndFunc   ;==>Form1_event
Func Form2_event()
        Switch @GUI_CtrlId
                Case $Button2
                        GUIDelete($Form2)
        EndSwitch
EndFunc   ;==>Form2_event
 楼主| 发表于 2010-10-2 19:24:43 | 显示全部楼层
回复 2# guland


    非常感谢这位大哥的热心帮助,还有个问题就是,如何将非AU3的窗口,嵌入到AU3窗口中呢。比如将QQ2010登录窗口嵌入到AU3当中应该怎么做呢.
发表于 2010-10-2 21:00:17 | 显示全部楼层
回复 3# 19377708

你去研究研究这个吧

    http://www.autoitx.com/forum.php ... ight=%CD%F8%B9%DCQQ
发表于 2010-10-4 18:00:37 | 显示全部楼层
回复 2# guland


    奥术打击阿萨德

评分

参与人数 1金钱 -10 收起 理由
afan -10

查看全部评分

发表于 2010-10-4 18:29:08 | 显示全部楼层
回复 5# 柠檬味的心


    啥意思???
发表于 2010-10-5 10:57:22 | 显示全部楼层

评分

参与人数 1金钱 -20 贡献 -1 收起 理由
afan -20 -1

查看全部评分

发表于 2010-10-5 22:05:32 | 显示全部楼层
回复  19377708
guland 发表于 2010-10-2 10:17



    Func form2()
        $Form2 = GUICreate("Form2", 482, 300, -1, -1,  BitOR($WS_MINIMIZEBOX, $WS_DLGFRAME, $WS_CLIPSIBLINGS), $ws_ex_mdichild, $Form1)
        $img = GUICtrlCreatePic("2.jpg", 0, 0, 1, 1)
        $Button2 = GUICtrlCreateButton("关闭此窗体", 190, 122, 103, 25)
        GUICtrlSetOnEvent(-1, "Form2_event")
        GUISetState(@SW_SHOW)
EndFunc   ;==>form2
发表于 2010-10-8 09:17:00 | 显示全部楼层
回复 2# guland


            $img = GUICtrlCreatePic("Water lilies.jpg", 0, 0, 1, 1)
;上面那个图片不加上就不行,不知道为什么......你自己随便找个图片就行,图片我就不上传了
我把换成JPG格式的了,运行没什么效果啊。
发表于 2010-10-8 20:33:22 | 显示全部楼层
回复 9# yiruirui

Water lilies.jpg  这个文件是不是在脚本的目录啊?

实在不行就随便弄个GIF的
发表于 2010-10-9 15:26:13 | 显示全部楼层
回复 10# guland


    哦,好的!3KS!
发表于 2012-3-20 10:40:03 | 显示全部楼层
父子窗口合并吗
发表于 2012-3-26 17:22:47 | 显示全部楼层
学习,留个印
发表于 2013-8-30 14:37:50 | 显示全部楼层
学习学习,例子运行没看到效果
发表于 2013-9-21 15:10:42 | 显示全部楼层
试试设置父窗口..
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-25 07:59 , Processed in 0.076453 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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