Guten Morgen zusammen,
der Befehl Hover macht mir wirklich das Leben schwer!
[autoit]
Local $hGUI, $Kat1, $Kat2, $Kat3, $Kat4 ,$nMsg, $fLableHovered
$hGUI = GUICreate("")
$Kat1 = GUICtrlCreateLabel("Text1",20,20,50,20)
$Kat2 = GUICtrlCreateLabel("Text2",30,40,50,20)
$Kat3 = GUICtrlCreateLabel("Text3",40,60,50,20)
$Kat4 = GUICtrlCreateLabel("Text4",50,80,50,20)
;GUICtrlSetCursor($Kat1,0)
GUISetState()
[/autoit][autoit][/autoit][autoit]While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case 0 ; kein GUI_Event
$aCursor = GUIGetCursorInfo($hGUI)
If Not IsArray($aCursor) Then ContinueLoop
_HoverKat() ; hoverfunktion für Text
[/autoit][autoit][/autoit][autoit]Case -3
Exit
EndSwitch
Wend
Func _HoverKat()
[/autoit][autoit][/autoit][autoit];Kat1--------------------->
If $aCursor[4] = $Kat1 Then ; Maus über Label
If Not $fLableHovered Then
GUICtrlSetColor($Kat1,0x0000FF)
$fLableHovered = True
EndIf
Else ; Maus nicht über Label
If $fLableHovered Then
GUICtrlSetColor($Kat1,0x000000)
$fLableHovered = False
EndIf
EndIf
;----------
;Kat2--------------------->
If $aCursor[4] = $Kat2 Then ; Maus über Label
If Not $fLableHovered Then
GUICtrlSetColor($Kat2,0x0000FF)
$fLableHovered = True
EndIf
Else ; Maus nicht über Label
If $fLableHovered Then
GUICtrlSetColor($Kat2,0x000000)
$fLableHovered = False
EndIf
EndIf
;---------
;Kat3-------------------->
If $aCursor[4] = $Kat3 Then ; Maus über Label
If Not $fLableHovered Then
GUICtrlSetColor($Kat3,0x0000FF)
$fLableHovered = True
EndIf
Else ; Maus nicht über Label
If $fLableHovered Then
GUICtrlSetColor($Kat3,0x000000)
$fLableHovered = False
EndIf
EndIf
;--------------------->
;Kat4--------------------->
If $aCursor[4] = $Kat4 Then ; Maus über Label
If Not $fLableHovered Then
GUICtrlSetColor($Kat4,0x0000FF)
$fLableHovered = True
EndIf
Else ; Maus nicht über Label
If $fLableHovered Then
GUICtrlSetColor($Kat4,0x000000)
$fLableHovered = False
EndIf
EndIf
;Kat1--------------------->
endfunc
[/autoit]Kann mir jemand sagen, warum das nicht vernünftig klappt!
Liebe Grüße
Ilse