这是tab标签吗?有谁做过[已解决]
本帖最后由 cqboyqx 于 2018-5-31 00:06 编辑我在别的软件上看到这种标签,是tab标签弄的吗?
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$Tab1 = GUICtrlCreateTab(16, 8, 569, 409,$TCS_VERTICAL)
$TabSheet1 = GUICtrlCreateTabItem("合同风格")
GUICtrlSetState(-1,$GUI_SHOW)
$Group1 = GUICtrlCreateGroup("Group1", 56, 40, 185, 385)
$TreeView1 = GUICtrlCreateTreeView(64, 56, 169, 361)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$TabSheet2 = GUICtrlCreateTabItem("文档风格")
$Group2 = GUICtrlCreateGroup("Group2", 40, 40, 185, 385)
$TreeView2 = GUICtrlCreateTreeView(48, 56, 169, 361)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$TabSheet3 = GUICtrlCreateTabItem("归档风格")
$Group3 = GUICtrlCreateGroup("Group3", 112, 40, 185, 385)
$TreeView3 = GUICtrlCreateTreeView(120, 56, 169, 361)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$TabSheet4 = GUICtrlCreateTabItem("付款风格")
$Group4 = GUICtrlCreateGroup("Group4", 264, 40, 185, 385)
$TreeView4 = GUICtrlCreateTreeView(272, 56, 169, 361)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd 本帖最后由 tubaba 于 2018-5-10 12:40 编辑
看样子应该是treeview,粗体字的项目只是主项,下面看起来是目录树的treeview只是粗体字项目的子项 回复 1# cqboyqx
tubaba有这方面的
http://www.autoit3.cn/thread-53514-1-1.html
本帖最后由 afan 于 2018-5-13 12:32 编辑
用Label模拟TAB标签,在点击时设置相关控件(子窗口)的坐标及显示状态,控件较多的话就用子窗口
以下自娱自乐,子窗口 + Label + Icon
这个应该不是tab标签,那软件是AU3做的吗 回复 5# 志艺风云
不是AU3做的,也不知道用什么编写的,如果au3能做出来也不错 回复 1# cqboyqx
回复 7# chzj589
厉害厉害,有点相似 回复 7# chzj589
源码可以发出来学习一下吗?大大 本帖最后由 chzj589 于 2018-5-12 16:04 编辑
回复 9# cqboyqx
用Label模拟TAB标签,在点击时设置相关控件(子窗口)的坐标及显示状态,控件较多的话就用子窗口
afan 发表于 2018-5-10 14:06 http://www.autoit3.cn/images/common/back.gif
就是用Label模拟TAB标签
YueFenH.ini
1=合同管理
2=客商管理
3=项目管理
4=货品管理
5=文档管理
6=统计汇总
7=系统设置
1=第一菜单
2=第二菜单
3=第三菜单
4=第四菜单
5=第五菜单
6=第六菜单
7=第七菜单
8=第八菜单
9=第九菜单
10=第十菜单 回复 10# chzj589
#AutoIt3Wrapper_icon=line.ico; zzsy.ico; C:\WINDOWS\system32\SHELL32.dll|-39.ico
#AutoIt3Wrapper_OutFile= Label模拟TAB标签.exe ;输出文件名
#AutoIt3Wrapper_Res_LegalCopyright=Copyright (c) chzj589 20180214
#AutoIt3Wrapper_OutFile_Type=exe ;文件类型
#AutoIt3Wrapper_UseX64 = n
#AutoIt3Wrapper_Compression=4 ;压缩等级
#AutoIt3Wrapper_UseUPX=y
#AutoIt3Wrapper_Res_Comment= Label模拟TAB标签 ;注释
#AutoIt3Wrapper_Res_Description=Label模拟TAB标签 ;详细信息
#AutoIt3Wrapper_Res_FileVersion=1.0.0.0
#AutoIt3Wrapper_Res_Field=ProductName|Label模拟TAB标签程序--win7-64-3.3.14.2;产品说明
#AutoIt3Wrapper_Res_Field=OriginalFilename|Label模拟TAB标签.au3
#AutoIt3Wrapper_Res_Language=2052
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <ListViewConstants.au3>
#include <ListBoxConstants.au3>
#include <GuiButton.au3>
#include <GuiListBox.au3>
Opt("GUIOnEventMode", 1)
Global $Form1, $PListViewa5, $plusBtn6
Local $sFilePathb1 = "YueFenh.ini"
Local $aArraya1 = IniReadSection($sFilePathb1, "IDCC")
_Form1()
While 1
Sleep(1000)
WEnd
Func _Form1()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Label模拟TAB标签", 800, 466, -1, -1, $WS_OVERLAPPEDWINDOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "btnClose")
GUISetBkColor(0xC0E0FF)
$plusBtn6 = GUICtrlCreateLabel("可在这里添加你的文件", 330, 168, 460, 40)
GUICtrlSetFont(-1, 18, 600)
GUICtrlSetColor(-1, 0xFF000F7F)
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$Group2 = GUICtrlCreateLabel("", 30, 10, 245, 430)
GUICtrlSetBkColor(-1, 0xC0C0C0)
GUICtrlSetColor(-1, 0xfbfcfd)
GUICtrlSetFont(-1, 11, 800, 0, "微软雅黑")
;GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
$Label1 = GUICtrlCreateLabel(" 合同管理", 48, 30, 198, 25)
GUICtrlSetBkColor(-1, 0x990000)
GUICtrlSetColor(-1, 0xfbfcfd)
GUICtrlSetFont(-1, 11, 800, 0, "微软雅黑")
;GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$Label2 = GUICtrlCreateLabel(" 客商管理", 48, 257, 198, 25)
GUICtrlSetBkColor(-1, 0x990000)
GUICtrlSetColor(-1, 0xfbfcfd)
GUICtrlSetFont(-1, 11, 800, 0, "微软雅黑")
;GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$Label3 = GUICtrlCreateLabel(" 项目管理", 48, 284, 198, 25)
GUICtrlSetBkColor(-1, 0x990000)
GUICtrlSetColor(-1, 0xfbfcfd)
GUICtrlSetFont(-1, 11, 800, 0, "微软雅黑")
;GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$Label4 = GUICtrlCreateLabel(" 货品管理", 48, 311, 198, 25)
GUICtrlSetBkColor(-1, 0x990000)
GUICtrlSetColor(-1, 0xfbfcfd)
GUICtrlSetFont(-1, 11, 800, 0, "微软雅黑")
;GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$Label5 = GUICtrlCreateLabel(" 文档管理", 48, 338, 198, 25)
GUICtrlSetBkColor(-1, 0x990000);
GUICtrlSetColor(-1, 0xfbfcfd)
GUICtrlSetFont(-1, 11, 800, 0, "微软雅黑")
;GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$Label6 = GUICtrlCreateLabel(" 统计汇总", 48, 365, 198, 25)
GUICtrlSetBkColor(-1, 0x990000)
GUICtrlSetColor(-1, 0xfbfcfd)
GUICtrlSetFont(-1, 11, 800, 0, "微软雅黑")
;GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$Label7 = GUICtrlCreateLabel(" 系统设置", 48, 392, 198, 25)
GUICtrlSetBkColor(-1, 0x990000)
GUICtrlSetColor(-1, 0xfbfcfd)
GUICtrlSetFont(-1, 11, 800, 0, "微软雅黑")
;GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$icoa1 = GUICtrlCreateIcon("", 2, 50, 33, 16, 16)
GUICtrlSetImage(-1, "shell32.dll", 6)
$ico2 = GUICtrlCreateIcon("", 2, 50, 259, 16, 16)
GUICtrlSetImage(-1, "shell32.dll", 46)
$ico3 = GUICtrlCreateIcon("", 2, 50, 286, 16, 16)
GUICtrlSetImage(-1, "shell32.dll", 137)
$ico4 = GUICtrlCreateIcon("", 2, 50, 313, 16, 16)
GUICtrlSetImage(-1, "shell32.dll", 38)
$ico5 = GUICtrlCreateIcon("", 2, 50, 340, 16, 16)
GUICtrlSetImage(-1, "shell32.dll", 146)
$ico6 = GUICtrlCreateIcon("", 2, 50, 367, 16, 16)
GUICtrlSetImage(-1, "shell32.dll", 45)
$ico7 = GUICtrlCreateIcon("", 2, 50, 394, 16, 16)
GUICtrlSetImage(-1, "shell32.dll", 168)
$PListViewa5 = GUICtrlCreateList("", 93, 55, 153, 200, $LBS_EXTENDEDSEL)
$hPListView = GUICtrlGetHandle($PListViewa5)
;GUICtrlSetLimit(-1, 200) ; 限制水平滚动
GUICtrlSetBkColor(-1, 0x990000); 背景色
GUICtrlSetColor(-1, 0xfbfcfd)
GUICtrlSetFont(-1, 10, 800, 0, 'Arial')
GUICtrlSetCursor(-1, 0)
_ddu()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
GUISetState(@SW_SHOW, $Form1)
#EndRegion ### END Koda GUI section ###
EndFunc ;==>_Form1
Func _ddu();读取
GUICtrlSetData($PListViewa5, "")
For $i = 1 To $aArraya1
GUICtrlSetData($PListViewa5, $aArraya1[$i], "")
Next
EndFunc ;==>_ddu
Func btnClose()
GUIDelete()
Exit
EndFunc ;==>btnClose
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox, $hWndListBox1, $txt
If Not IsHWnd($PListViewa5) Then $hWndListBox = GUICtrlGetHandle($PListViewa5)
$hWndFrom = $ilParam
$iIDFrom = BitAND($iwParam, 0xFFFF)
$iCode = BitShift($iwParam, 16)
Switch $hWndFrom
Case $PListViewa5, $hWndListBox
Switch $iCode
Case $LBN_SELCHANGE
$txt = _GUICtrlListBox_GetSelItemsText($PListViewa5)
MsgBox(0, 0, $txt, 1)
GUICtrlSetData($plusBtn6, $txt & "---可在这里添加你的文件")
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
回复 11# chzj589
怎么回事,是不是我这里少了个文件 回复 12# qsy666888
是的,少了YueFenH.ini。
在10楼 回复 1# cqboyqx
这应该室最简单的实现方式,细节方面可自行调整
#include <GUIConstantsEx.au3>
#include <GuiTreeView.au3>
#include <WindowsConstants.au3>
$hGUI = GUICreate("", 640, 480)
$Btn0 = GUICtrlCreateButton("合同管理", 5, 5, 130, 24) ;3个用来测试切换tab分页的按钮
$Btn1 = GUICtrlCreateButton("客商管理", 5, 425, 130, 24)
$Btn2 = GUICtrlCreateButton("项目管理", 5, 450, 130, 24)
$hTab = GUICtrlCreateTab(-1110, 10, 800, 640) ;创建tab控件,注意坐标
GUICtrlCreateTabItem("标签0")
$hTreeView0 = GUICtrlCreateTreeView(5, 30, 130, 394)
$hTvItem0 = GUICtrlCreateTreeViewItem("客商分类目录", $hTreeView0)
GUICtrlCreateTreeViewItem("按合同分类", $hTvItem0)
GUICtrlCreateTreeViewItem("按合同部门", $hTvItem0)
GUICtrlCreateTreeViewItem("按合同归档", $hTvItem0)
GUICtrlCreateTabItem("标签1")
$hTreeView1 = GUICtrlCreateTreeView(5, 55, 130, 394)
$hTvItem1 = GUICtrlCreateTreeViewItem("客商分类目录", $hTreeView1)
GUICtrlCreateTreeViewItem("客户", $hTvItem1)
GUICtrlCreateTreeViewItem("供应商", $hTvItem1)
GUICtrlCreateTabItem("标签2")
$hTreeView2 = GUICtrlCreateTreeView(5, 80, 130, 394)
$hTvItem2 = GUICtrlCreateTreeViewItem("项目分类目录", $hTreeView2)
GUICtrlCreateTreeViewItem("访谈室建设项目", $hTvItem2)
GUICtrlCreateTreeViewItem("信息化项目", $hTvItem2)
GUICtrlCreateTabItem("")
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $Btn0
GUICtrlSendMsg($hTab, 4912, 0, 0)
ControlMove($hGUI, "", $Btn1, 5, 425)
ControlMove($hGUI, "", $Btn2, 5, 450)
Case $Btn1
GUICtrlSendMsg($hTab, 4912, 1, 0)
ControlMove($hGUI, "", $Btn1, 5, 30)
ControlMove($hGUI, "", $Btn2, 5, 450)
Case $Btn2
GUICtrlSendMsg($hTab, 4912, 2, 0)
ControlMove($hGUI, "", $Btn1, 5, 30)
ControlMove($hGUI, "", $Btn2, 5, 55)
EndSwitch
WEnd
回复 13# chzj589
回复 14# 298311657
谢谢两位大侠,后面慢慢细化,非常感谢感谢两位大大