检测当前选择的标签
#Include <GuiTab.au3>
_GUICtrlTab_GetCurSel($hWnd)
$hWnd | 标签控件的句柄 |
#include <GUIConstantsEx.au3>
#include <GuiTab.au3>
$Debug_TAB = False ; 检查传递给函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作
_Main()
Func _Main()
Local $hTab
; 创建 GUI
GUICreate("Tab Control Get Current Selected", 400, 300)
$hTab = GUICtrlCreateTab(2, 2, 396, 296)
GUISetState()
; 添加标签
_GUICtrlTab_InsertItem($hTab, 0, "Tab 1")
_GUICtrlTab_InsertItem($hTab, 1, "Tab 2")
_GUICtrlTab_InsertItem($hTab, 2, "Tab 3")
; Get/Set current selection
_GUICtrlTab_SetCurSel($hTab, 1)
MsgBox(4160, "信息", "Current Selection: " & _GUICtrlTab_GetCurSel($hTab))
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main