Errorlevel_03 Posted July 28, 2005 Posted July 28, 2005 (edited) GUICreate("Question", 185, 107, -1, -1, -1) GUICtrlCreateButton("Yes", 20, 60, 61, 35) GUICtrlCreateButton("No", 100, 60, 61, 35) GUICtrlCreateLabel("Are you dreaming?", 60, 20, 75, 40) GUISetState() While 1 $Mouse = MouseGetPos() $P1 = $Mouse[0] $P2 = $Mouse[1] If $P1 = 141 <= 199 Then no() ElseIf $P2 = 554 <= 586 Then no() Else GUICtrlSetState(4, $GUI_ENABLE) EndIf Wend Func no() GUICtrlSetState(4, $GUI_DISABLE) EndFunc Im hoping the "No" button will disable if you put your mouse over it but all i get is an error right off the bat. Edited July 28, 2005 by Errorlevel_03 I hope you know what a spoiler is...[u]"title WOOPS:Var_start "WOOPS" %0goto Var_"-A true n00b at work[/u]
blindwig Posted July 28, 2005 Posted July 28, 2005 You forgot to include GuiConstants My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions
Errorlevel_03 Posted July 28, 2005 Author Posted July 28, 2005 You forgot to include GuiConstants <{POST_SNAPBACK}>hehe thanks I hope you know what a spoiler is...[u]"title WOOPS:Var_start "WOOPS" %0goto Var_"-A true n00b at work[/u]
Dickb Posted July 28, 2005 Posted July 28, 2005 (edited) Errorlevel 03, look at this exampleFor questions, see the help file (and the examples in it)I hope that this helps you on your way.Dick#include <GUIConstants.au3>$Hide = FalseGUICreate("Question", 185, 107, -1, -1, -1)$Yes = GUICtrlCreateButton("Yes", 20, 60, 61, 35)$No = GUICtrlCreateButton("No", 100, 60, 61, 35)GUICtrlCreateLabel("Are you dreaming?", 60, 20, 75, 40)GUISetState()OPt("MouseCoordMode", 2)While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect $Mouse = MouseGetPos() $P1 = $Mouse[0] $P2 = $Mouse[1] If ($P1 > 99 And $P1 < 161) And ($P2 > 59 And $P2 < 97) Then If ($Hide = False) Then no() ElseIf ($Hide = True) Then $Hide = False GUICtrlSetState(4, $GUI_ENABLE) EndIfWEndExitFunc no() $Hide = True GUICtrlSetState(4, $GUI_DISABLE)EndFunc ;==>no Edited July 28, 2005 by Dickb
LxP Posted July 29, 2005 Posted July 29, 2005 If $P1 = 141 <= 199 Then no() ElseIf $P2 = 554 <= 586 Then no() Else GUICtrlSetState(4, $GUI_ENABLE) EndIfThis will cause you errors. I think you are after this:if ($p1 >= 141 and $p1 <= 199) then no() elseIf ($p2 >= 554 and $p2 <= 586) then no() else guiCtrlSetState(4, $GUI_ENABLE) endIfEach condition within an If..Then instruction must be complete on its own.
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