onedayillpay Posted February 16, 2007 Share Posted February 16, 2007 i think i know why this doesnt work, so can some one show me how i can make this merlin.gif move #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $pic2_left = 150 $pic2_top = 20 $Pic_2 = GuiCtrlCreatePic(@Systemdir & "\oobe\images\merlin.gif", $pic2_left,$pic2_top, 60, 60) $Input_1 = GuiCtrlCreateInput("", 100, 80, 20, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Input_1 if GUICtrlRead($Input_1) = "2" then $pic2_left = 150; pictur move $pic2_top = 90 EndIf EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
BigDod Posted February 16, 2007 Share Posted February 16, 2007 This one works #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $pic2_left = 150 $pic2_top = 20 $Pic_2 = GuiCtrlCreatePic(@Systemdir & "\oobe\images\merlin.gif", $pic2_left,$pic2_top, 60, 60) $Input_1 = GuiCtrlCreateInput("", 100, 80, 20, 20) $Button1 = GUICtrlCreateButton("Move", 60, 80, 40, 20, 0) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 if GUICtrlRead($Input_1) = "2" then $pic2_left = 150 $pic2_top = 90 GUICtrlSetPos ($Pic_2,$pic2_left,$pic2_top) EndIf EndSelect WEnd Exit Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
onedayillpay Posted February 16, 2007 Author Share Posted February 16, 2007 ahhh I see... thanks Link to comment Share on other sites More sharing options...
onedayillpay Posted February 17, 2007 Author Share Posted February 17, 2007 (edited) i dont understand why the secend time you enter 2 in to the input box, the pic2.bmp wont move back... expandcollapse popup$pic2_left = 150 $pic2_top = 20 $Pic_2 = GuiCtrlCreatePic(@DesktopDir & "\puzzle\pic2.bmp", $pic2_left,$pic2_top, 60, 60) $freespotLeft = 150 $freespotTop = 90 $input = GUICtrlCreateInput ("", 170, 240, 20, 20) $move = GUICtrlCreateButton("Move", 160, 260, 40, 20, 0) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $move; Button if GUICtrlRead($Input) = "2" then if $freespotLeft = 150 Then if $freespotTop = 90 Then $pic2_left = 150 $pic2_top = 90 $freespotLeft = 150 $freespotTop = 20 GUICtrlSetPos ($Pic_2,$pic2_left,$pic2_top) EndIf EndIf EndIf Case $msg = $move; Button if GUICtrlRead($Input) = "2" then if $freespotLeft = 150 Then if $freespotTop = 20 Then $pic2_left = 150 $pic2_top = 20 $freespotLeft = 150 $freespotTop = 90 GUICtrlSetPos ($Pic_2,$pic2_left,$pic2_top) EndIf EndIf EndIf EndSelect WEnd Exit Edited February 17, 2007 by onedayillpay 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