Danke, gefällt mir aber optisch nicht so
Danke, gefällt mir aber optisch nicht so
Ich habe mal mit _WinAPI_GetSysColor($COLOR_MENU) die Farbe ermittelt. Ist dies wirklich die Hintergrundfarbe des Fensters oder nur die gleiche von einem anderen Element?
AutoIt
#Region ;************ Includes ************
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiTab.au3>
#EndRegion ;************ Includes ************
;Farbe des Fensters
$farbe = "0x" & StringTrimLeft(Hex(Number(_WinAPI_GetSysColor($COLOR_MENU), 1), 8), 2)
ConsoleWrite($farbe & @CRLF)
; Tab colours
Global $aTabColours[4] = [$farbe, $farbe, $farbe, $farbe]
; 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)
_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