Jump to content

GUICtrlSetOnHover proplem


Recommended Posts

i use GUICtrlSetOnHover udf

but the button in Tab Item and when i moved on the button or click it fast

the button is flashing

how i can stop this flash

#include <GUIConstantsEx.au3>
#include <GuiTab.au3>
#include "UDFs\Icons.au3"
#include "UDFs\GUICtrlSetOnHover.au3"

Global $Hold = False
Global $Tab1_Background, $Tab1_Button1, $Tab1_Button2, $Tab1_Button3, $tab1

$GUI = GUICreate("Form1", 800, 600, -1, -1)
GUICtrlCreatePic(@ScriptDir & "\images\background_1.bmp", 0, 0, 800, 600, $WS_CLIPSIBLINGS)
GUICtrlSetState(-1, $GUI_DISABLE)

$MainTab = GUICtrlCreateTab(10, 200, 780, 390, $TCS_MULTILINE)
GUICtrlSetState(-1, $GUI_ONTOP)
GUISetFont(14, 700)

$tab1 = GUICtrlCreateTabItem("tab1")
$Tab1_Background = GUICtrlCreatePic(@ScriptDir & "\images\background_1.bmp", 10, 220, 780, 370)
GUICtrlSetState(-1, $GUI_DISABLE)
$Tab1_Button1 = GUICtrlCreatePic("", 380, 280, 90, 22)
GUICtrlSetOnHover(-1, '_HoverButton', '_LeaveButton', '_DownButton', '_HoverButton')
_LeaveButton($Tab1_Button1)
GUICtrlCreateTabItem("") ; end tabitem definition
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func _DownButton($CtrlID)
    If $Hold Then
        Return
    Else
        $Hold = True
    EndIf
    Local $File

    _SetImage($CtrlID, @ScriptDir & '\Images\Button1_down.png' & $File, $Tab1_Background)
EndFunc   ;==>_DownButton
Func _LeaveButton($CtrlID)
    Local $File
    _SetImage($CtrlID, @ScriptDir & '\Images\Button1_over.png' & $File, $Tab1_Background)
    $Hold = False
EndFunc   ;==>_LeaveButton
Func _HoverButton($CtrlID)
    Local $File
    _SetImage($CtrlID, @ScriptDir & '\Images\Button1_normal.png' & $File, $Tab1_Background)
    $Hold = False
EndFunc   ;==>_HoverButton

all files i used here

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...