找回密码
 加入
搜索
楼主: heroxianf

[GUI管理] 天空这种切换界面是如何实现的呢[已解决]

 火... [复制链接]
 楼主| 发表于 2016-4-21 13:53:58 | 显示全部楼层
回复 30# chzj589

23  HAI大链接也可以参考,谢谢你们了。
发表于 2016-4-21 14:32:50 | 显示全部楼层
本帖最后由 131738 于 2016-4-21 14:35 编辑
回复  131738

这写的乱七八糟的  指点一下哈
heroxianf 发表于 2016-4-21 10:46


我也是乱七八糟的, 包含以下哈........
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 846, 452, 246, 132)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
$Button1 = GUICtrlCreateButton("显示2", 16, 96, 75, 25)
GUICtrlSetOnEvent($Button1, "test")
$Button2 = GUICtrlCreateButton("返回", 16, 136, 75, 25)
GUICtrlSetOnEvent($Button2, "fanhui")
$Tab1 = GUICtrlCreateTab(1, 1, 1, 1)
;标签页 1
$Tab1 = GUICtrlCreateTabItem("tab1")
$Label1 = GUICtrlCreateLabel("Label1", 288, 112, 412, 17)
$Button3 = GUICtrlCreateButton("界面1", 288, 136, 75, 25)
GUICtrlSetOnEvent($Button3, "jiemian1")
GUICtrlCreateTabItem("")
;标签页 2
$Tab2 = GUICtrlCreateTabItem("tab2")
$Label5 = GUICtrlCreateLabel("Label2", 200, 150, 412, 17)
$Button6 = GUICtrlCreateButton("界面2", 200, 170, 75, 25)
GUICtrlSetOnEvent($Button6, "jiemian1")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        Sleep(100)
WEnd
Func test()
        GUICtrlSetState($Tab2, $GUI_SHOW)
EndFunc   ;==>test
Func fanhui()
        GUICtrlSetState($Tab1, $GUI_SHOW)
EndFunc   ;==>fanhui
Func jiemian1()
        MsgBox(0, "", "界面1")
EndFunc   ;==>jiemian1
Func jiemian2()
        MsgBox(0, "", "界面2")
EndFunc   ;==>jiemian2
Func _exit()
        Exit
EndFunc   ;==>_exit
 楼主| 发表于 2016-4-21 14:48:17 | 显示全部楼层
回复 32# 131738


    谢谢13大,  但是那个框框呢。我要控件在框框里哈~
发表于 2016-4-21 15:04:26 | 显示全部楼层
回复  131738


    谢谢13大,  但是那个框框呢。我要控件在框框里哈~
heroxianf 发表于 2016-4-21 14:48


如果要 Tab 的框,就不是这个写法了, 就应该使用明显的tab控件了
一个窗口只能创建一个tab控件. 但可以创建若干各持一个选项卡控件的子窗口.
可以使用组框(Group)控件,或 _GUICtrlButton_Create() 创建 $BS_GROUPBOX 样式的按钮, 其它控件置于这个按钮框内(没有试过!瞎猜的!)
 楼主| 发表于 2016-4-21 15:26:31 | 显示全部楼层
回复 34# 131738

好的,等我都试试各位大大说的方法看看效果。谢谢了~
发表于 2016-4-23 19:19:23 | 显示全部楼层
回复 32# 131738


    很容易看懂,收藏了,谢谢。
发表于 2016-4-23 23:06:00 | 显示全部楼层
回复 32# 131738


    学习了
发表于 2016-4-23 23:11:13 | 显示全部楼层
回复  131738


    学习了
zldfsz 发表于 2016-4-23 23:06


不敢当啊, 老仙师....
发表于 2016-4-24 08:16:14 | 显示全部楼层
回复 35# heroxianf

己解决!LZ能把解决的代码发布,让大家学习学习
 楼主| 发表于 2016-4-24 11:27:34 | 显示全部楼层
回复 39# chzj589


参考23楼哈
发表于 2016-4-24 13:39:51 | 显示全部楼层
回复 40# heroxianf
GUICtrlCreateButton控件与GUICtrlCreateListView控件
但你1楼的图,用的应该不是这两个控件能达到的。
所以问LZ是如何解决?
 楼主| 发表于 2016-4-24 14:44:02 | 显示全部楼层
回复 41# chzj589


    23楼第二个  软件菜单II示例,我也在看着消化,你去看看哈
发表于 2016-4-24 16:27:18 | 显示全部楼层
回复 42# heroxianf
就是GUICtrlCreateButton控件与GUICtrlCreateListView控件
在GUICtrlCreateListView控件里能再建其它控件吗?
这是软件安装,将EXE软件拖入GUICtrlCreateListView控件框,用INI保存。
我在想你好象没解决?
发表于 2016-4-24 19:28:48 | 显示全部楼层
大概看了下上面的代码,感觉你们把这个想的有点复杂了,其实很简单,看我的实现代码。


#include <GUIConstantsEx.au3>

GUICreate("选项卡控件 GUI", 800, 640)


$Btn0 = GUICtrlCreateButton("0", 20, 5, 50, 20) ;3个用来测试切换tab分页的按钮
$Btn1 = GUICtrlCreateButton("1", 80, 5, 50, 20)
$Btn2 = GUICtrlCreateButton("2", 140, 5, 50, 20)

$hTab = GUICtrlCreateTab(-1110, 10, 800, 640);创建tab控件,注意坐标

GUICtrlCreateTabItem("标签0")
GUICtrlCreateLabel("文本 0", 30, 80, 50, 20)
GUICtrlCreateButton("确定 0", 20, 50, 50, 20)
GUICtrlCreateInput("默认", 80, 50, 70, 20)

GUICtrlCreateTabItem("标签1")
GUICtrlCreateLabel("文本 1", 30, 80, 50, 20)
GUICtrlCreateCombo("", 20, 50, 60, 120)
GUICtrlSetData(-1, "三和弦|数码|拉里|乔恩|泰罗|吉尼斯", "乔恩")
GUICtrlCreateButton("确定 1", 80, 50, 50, 20)

GUICtrlCreateTabItem("标签2")
GUICtrlCreateLabel("文本 2", 30, 80, 50, 20)
GUICtrlCreateButton("确定 2", 140, 50, 50)

GUICtrlCreateTabItem("")

GUISetState()

While 1
        Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                        ExitLoop
                Case $Btn0
                        GUICtrlSendMsg($hTab, 4912, 0, 0)
                Case $Btn1
                        GUICtrlSendMsg($hTab, 4912, 1, 0)
                Case $Btn2
                        GUICtrlSendMsg($hTab, 4912, 2, 0)
        EndSwitch
WEnd

发表于 2016-4-25 08:48:43 | 显示全部楼层
回复 44# 298311657

我想LZ要的是这种效果:





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-16 13:34 , Processed in 0.076914 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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