#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
Global $tab_item[101], $iHeight1 = 100, $iHeight2
$GUI_main = GUICreate("测试",350,$iHeight1)
GUISetState()
$TAB= GUICtrlCreateTab(0,0,350,25,$TCS_MULTILINE ) ;TAB 指标签控件 $TCS_MULTILINE 多行显示
GUICtrlSetFont($TAB,14);设置标签字体
For $i = 1 To Random(1,100,1);创建随机个数的标签
$tab_item[$i] = GUICtrlCreateTabItem("tag"&$i)
Next
ConsoleWrite($i&@CRLF)
Local $iCount = Int($i/5)
If Mod($i, 5) <> 0 Then $iCount += 1
$iHeight2 = $iCount*25
GUICtrlSetPos($TAB, 0, 0, 350, $iHeight2)
If $iHeight2 > $iHeight1 Then
Local $aPos = WinGetPos($GUI_main)
WinMove($GUI_main, '', $aPos[0], $aPos[1], 350, $iHeight2+50)
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|