$OPTIMIZE ON
$TYPECHECK ON
$INCLUDE "rapidq.inc"
DECLARE SUB Clicky
DEFINT i = 0, up = False
CREATE Form AS QFORM
CAPTION = "Bouncing Buttons!"
Width = 410
Height = 500
Center
END CREATE
DIM Button(5) AS QBUTTON
FOR i = 1 TO 5
Button(i).PARENT = Form
Button(i).Top = 5
Button(i).Left = (75 * (i - 1)) + (i * 5)
Button(i).OnClick = Clicky
Button(i).CAPTION = "Button &" + STR$(i)
NEXT i
Form.SHOWMODAL
SUB Clicky
DEFINT i = 0, a = 0
IF(up) THEN
a = 6
ELSE
a = 425
END IF
FOR i = 1 TO 5
Button(i).Top = a
NEXT i
up = NOT(up)
END SUB
|