Guidance
指路人
g.yi.org
software / rapidq / Examples / Devices / mouse / Drag.bas

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

  
     DECLARE FUNCTION GetAsyncKeyState LIB "user32" ALIAS _
      "GetAsyncKeyState" (vKey AS LONG) AS INTEGER
     DECLARE SUB scanmouse
     DIM scan AS QTIMER
     scan.ontimer=scanmouse
     scan.interval=100

     CREATE Form AS QFORM
      CREATE s AS QEDIT
       text="Drag me!"
      END CREATE
     END CREATE
     Form.SHOWMODAL

     SUB scanmouse
      IF getasynckeystate(1)<>0 THEN
       screen.cursor=-12
       DIM oldx AS SHORT,oldy AS SHORT
       DIM oldleft AS SHORT,oldtop AS SHORT
       oldx=screen.MOUSEX:oldy=screen.MOUSEY
       oldleft=s.left:oldtop=s.top
       WHILE getasynckeystate(1)<>0
        s.left=oldleft+screen.MOUSEX-oldx
        s.top=oldtop+screen.MOUSEY-oldy
       WEND
       screen.cursor=0
      END IF
     END SUB
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2024-4-25  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-05-31 20:31:12