Keine Ahnung, warum das Löschen bei Tabs nicht funzt, aber als Alternative kannst du noch eine Hintergrund Bitmap zum Löschen erstellen.
Spoiler anzeigen
#include <GuiTab.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
;~ #include <WindowsConstants.au3>;~~~
;~ #include <WinAPI.au3>;~~~
Global $hImage, $hBitmap, $hBmpOn, $hBmpOff
Global $acPic[10]
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\on.png")
$hBitmap = _GDIPlus_BitmapCloneArea($hImage, 0, 0, 16, 16, $GDIP_PXF32ARGB)
$hBmpOn = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_ImageDispose($hImage)
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\off.png")
$hBitmap = _GDIPlus_BitmapCloneArea($hImage, 0, 0, 16, 16, $GDIP_PXF32ARGB)
$hBmpOff = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
_GDIPlus_BitmapDispose($hBitmap)
$hBitmap = _GDIPlus_BitmapCloneArea($hImage, 0, 0, 16, 16, $GDIP_PXF32ARGB)
$hCtx = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsClear($hCtx, 0xFFFFFFFF)
_GDIPlus_GraphicsDispose($hCtx)
$hBmpClear = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_Shutdown()
Global $hGUI = GUICreate("Test")
Global $cTab = GUICtrlCreateTab(5, 5, 380, 200)
Global $hTab = GUICtrlGetHandle($cTab)
GUICtrlCreateTabItem("Test1")
GUICtrlCreateButton("Test", 80, 80, 80, 25)
GUICtrlCreateTabItem("Test2")
For $i = 0 To 9
$acPic[$i] = GUICtrlCreatePic("", 50 + (30 * $i), 50, 16, 16)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpOff)
Next
GUICtrlCreateTabItem("")
GUISetState()
While 1
For $i = 0 To 9
_WinAPI_DeleteObject(GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpClear))
If Random(0, 1, 1) = 1 Then
_WinAPI_DeleteObject(GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpOn))
Else
_WinAPI_DeleteObject(GUICtrlSendMsg($acPic[$i], 0x0172, 0, $hBmpOff))
EndIf
Next
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_WinAPI_DeleteObject($hBmpClear)
_WinAPI_DeleteObject($hBmpOn)
_WinAPI_DeleteObject($hBmpOff)
Exit
EndSwitch
WEnd
Gruß,
UEZ