Code: Select all
#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
Gui Add, Text, x171 y155 w120 h23 +0x200 Center vMoveText, Moving
Gui Add, Button, x372 y24 w80 h23 gMoveRight, Right
Gui Add, Button, x373 y50 w80 h23 gMoveUp, Up
Gui Add, Button, x373 y78 w80 h23 gResetTimer, Reset
Gui Show, w460 h360, Moving
Return
MoveRight:
controlgetpos, rightx, righty,,,Static1, Moving
settimer, movesteps, 40
return
movesteps:
rightx += 2
guicontrol, move, Static1, x%rightx%
return
MoveUp:
controlgetpos, upx, upy,,,Static1, Moving
settimer, movestepsup, 40
return
movestepsup:
upy -=2
guicontrol, move, Static1, y%upy%
return
ResetTimer:
settimer, movestepsup, Off
settimer, movesteps, Off
guicontrol, move, Static1, x171 y155
return
GuiEscape:
GuiClose:
ExitApp