gottygolly Posted January 6, 2015 Share Posted January 6, 2015 Wasn't sure what to name the title... I know what the problem is I was just wondering how I would go about making it so when the mouse isn't on the button it just makes the gui background color white 1 time instead of how it's currently doing it (Making it white infinite amount of times). Any solutions will help, thanks! Func _Mouse_Hover($Control) $Title = WinGetTitle("") $ControlPos = ControlGetPos($Title,"",$Control) $MousePos = GUIGetCursorInfo($Title) If $MousePos[0] > $ControlPos[0] And $MousePos[0] < $ControlPos[0] + $ControlPos[2] And $MousePos[1] > $ControlPos[1] And $MousePos[1] < $ControlPos[1] + $ControlPos[3] Then GUISetBkColor(0x000000) Else GUISetBkColor(0xFFFFFF) EndIf EndFunc Link to comment Share on other sites More sharing options...
JohnOne Posted January 7, 2015 Share Posted January 7, 2015 Set a flag true or false, and only act accordingly. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
TheSaint Posted January 7, 2015 Share Posted January 7, 2015 How many times are you calling that function? As it will stay the specified color until the function is called again, and mouse position has changed. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
AutID Posted January 7, 2015 Share Posted January 7, 2015 The second time this function will run will not make the background white Global $checker = False Func _Mouse_Hover($Control) $Title = WinGetTitle("") $ControlPos = ControlGetPos($Title,"",$Control) $MousePos = GUIGetCursorInfo($Title) If $MousePos[0] > $ControlPos[0] And $MousePos[0] < $ControlPos[0] + $ControlPos[2] And $MousePos[1] > $ControlPos[1] And $MousePos[1] < $ControlPos[1] + $ControlPos[3] Then GUISetBkColor(0x000000) Else If $checker = False Then GUISetBkColor(0xFFFFFF) $checker = True EndIf EndIf EndFunc https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now