Jump to content
Sign in to follow this  

GUICtrlOnHover in _AnyGui

Recommended Posts


Merry Christmas for All.

Can someone tell me what is wrong with this code?

When i make with a Gui, the function PrimaryDown_Proc($iCtrlID) works well. But, when i put in a _AnyGUI_AddChild or

_AnyGUI_Create/_AnyGUI_AddTab, the "_Hover_Func", "_Leave_Hover_Func" works well, but the function PrimaryDown_Proc($iCtrlID) never works. Can someone help me? Regards!

$ct = NET_ControlGetHandleByName("", "", "Test")

$ctl = _AnyGUI_AddChild ("", 0,0,790,60, $ct)

$varTab = GUICtrlCreateTab(0, 0, 790, 60)

$optbarFile = IniReadSectionNames("search.ini")

If Not IsArray($optbarFile) Then Return


For $z = 1 To $optbarFile[0]

$optbarAreas = IniReadSectionNames($optbarFile[$z])

If Not IsArray($optbarAreas) Then Exit


Local $varTabItem[uBound($optbarAreas)], $Button[uBound($optbarAreas)]

$varTabItem = GUICtrlCreateTabItem(StringTrimRight($optbarFile[$z],4))

For $x = 1 To $optbarAreas[0]

If @error Then ContinueLoop

$X_Coord = 5 + (($x - 1) * 65)

$Button = GUICtrlCreateButton($optbarAreas[$x], $X_Coord, 25, 60, 30)

_GUICtrl_OnHoverRegister(1, "_Hover_Func", "_Leave_Hover_Func", "PrimaryDown_Proc")

GUICtrlSetBkColor(-1, $Btn_Color)





_GUICtrlTab_SetCurFocus($varTab, 0)

Func PrimaryDown_Proc($iCtrlID)

Switch $iCtrlID

Case $iCtrlID

MsgBox(0, "", _GUICtrlTab_GetItemText($varTab, _GUICtrlTab_GetCurFocus($varTab)) & " - " & GUICtrlRead($iCtrlID), 2)



Func _Hover_Func($iCtrlID)

GUICtrlSetBkColor($iCtrlID, $Hover_Color)


Func _Leave_Hover_Func($iCtrlID)

GUICtrlSetBkColor($iCtrlID, $Btn_Color)


Share this post

Link to post
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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.