Hi,
ich würde gerne den Tab in der gleichen Hintergrundfarbe wie die GUI erstellen.
In dem Beispiel ist die GUI grau und der Tab weiß.
Es soll aber beides grau sein.
Wie kann man die Hintergrundfarbe der GUI auslesen?
Außerdem flackern die Tabs wie wild, wenn ich die Checkbox "Tab umbenennen" anklicke
AutoIt
#Region ;************ Includes ************
#include <GuiConstantsEx.au3>
#include <GuiTab.au3>
#EndRegion ;************ Includes ************
; Tab colours
Global $aTabColours[4] = [0xFFC0C0, 0xC0FFC0, 0xC0C0FF, 0xC0C0C0]
; Create GUI
Global $hGUI = GUICreate("Test", 400, 300)
; Create tab
Global $hTab = GUICtrlCreateTab(5, 5, 390, 290)
; Create Tab items and colour them
For $i = 0 To 3
GUICtrlCreateTabItem("Tab item - " & $i)
If $i > 1 Then _GUICtrlTab_SetBkColor($hGUI, $hTab, $aTabColours[$i])
GUICtrlCreateTabItem("")
Next
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor)
; Get Tab position
Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32)
; Get size of user area
Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1)
; Create label
GUICtrlCreateLabel("", $aTabPos[0] + 2, $aTabPos[1] + $aTab_Rect[3] + 4, $aTabPos[2] - 6, $aTabPos[3] - $aTab_Rect[3] - 7)
; colour label
GUICtrlSetBkColor(-1, $sBkColor)
; Disable label
GUICtrlSetState(-1, $GUI_DISABLE)
EndFunc ;==>_GUICtrlTab_SetBkColor
Alles anzeigen