确实很奇怪,做了个测试:不删控件,只删控件数组中控件句柄。
怪事又出现了。
#include <GuiTab.au3>
#include <array.au3>
GUICreate('test')
$Tab = GUICtrlCreateTab(5, 5, 392, 360)
Dim $L[7]
For $i = 0 To 6
GUICtrlCreateTabItem($i)
$L[$i] = GUICtrlCreateLabel($i, 20 + $i * 48, 50)
Next
GUICtrlCreateTabItem('')
_ArrayDisplay($L)
$Button1 = GUICtrlCreateButton('删除当前标签', 100, 370, 100, 22)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $Button1
$i = _GUICtrlTab_GetCurSel($Tab)
$c = _GUICtrlTab_GetItemText($Tab, $i)
;GUICtrlDelete($L[$c])
_ArrayDelete($L,$i)
_GUICtrlTab_DeleteItem($Tab, $i)
;~ Case $Tab
;~ MsgBox(0,_GUICtrlTab_GetCurSel($Tab),_GUICtrlTab_GetItemCount($Tab))
EndSwitch
WEnd
|