Guidance
指路人
g.yi.org
software / rapidq / examples / gui / Button / Bouncing Buttons.rqb

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     $OPTIMIZE ON
     $TYPECHECK ON
     $INCLUDE "rapidq.inc"

     DECLARE SUB Clicky
     DEFINT i = 0, up = False

'Create Form and Buttons
     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

'Show Form...
     Form.SHOWMODAL

'Bounces Buttons
     SUB Clicky
      DEFINT i = 0, j = 0, a = 0, b = 0, tick = 0

      IF(up) THEN
       a = 425
       b = 6
       tick = -1
      ELSE
       a = 6
       b = 425
       tick = 1
      END IF

      FOR i = a TO b STEP tick
       FOR j = 1 TO 5
        Button(j).Top = i
        DOEVENTS
       NEXT j
      NEXT i

      up = NOT(up)
     END SUB
掌柜推荐
 
 
¥296.00 ·
 
 
¥650.00 ·
 
 
¥888.00 ·
 
 
¥420.00 ·
 
 
¥1,480.00 ·
 
 
¥296.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-11-06 18:06:18