Guidance
指路人
g.yi.org
software / rapidq / Examples / Devices / keyboard / Tab.bas

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

  
'From: aej
' Re: How to read the TAB key??
' Sep 12th, 2002, 5:35pm

     $ESCAPECHARS ON
     DECLARE SUB Key1(Key AS WORD, Shift AS INTEGER)
     DECLARE SUB Key2(Key AS WORD, Shift AS INTEGER)
     DECLARE SUB Key3(Key AS BYTE)
     DECLARE SUB ClearFields

     CREATE Form AS QFORM
      Width = 220
      Height = 130
      BorderStyle = 4
      CREATE Label AS QLABEL
       Top = 9
       Left = 10
       CAPTION = "OnKeyDown\n\n_
OnKeyUp\n\n_
OnKeyPress"
      END CREATE
      CREATE Edit1 AS QEDIT
       Top = 7
       Left = 80
       ReadOnly = True
       Enabled = False
      END CREATE
      CREATE Edit2 AS QEDIT
       Top = 32
       Left = 80
       ReadOnly =True
       Enabled = False
      END CREATE
      CREATE Edit3 AS QEDIT
       Top = 58
       Left = 80
       ReadOnly = True
       Enabled = False
      END CREATE
      CREATE Dummy AS QBUTTON
       Width = 0
       TabOrder = 0
      END CREATE
      CREATE Clear AS QBUTTON
       Top = 84
       Left = 90
       Width = 100
       Height = 20
       CAPTION = "Clear Fields"
       TabOrder = 1
       OnClick = ClearFields
      END CREATE
      KeyPreview = 1
      OnKeyDown = Key1
      OnKeyUp = Key2
      OnKeyPress = Key3
      Center
      SHOWMODAL
     END CREATE

     SUB Key1(Key, Shift)
      Edit1.Text = "Key " + STR$(Key) + " Shift " + STR$(Shift)
     END SUB

     SUB Key2(Key, Shift)
      Edit2.Text = "Key " + STR$(Key) + " Shift " + STR$(Shift)
     END SUB

     SUB Key3(Key)
      Edit3.Text = "Key " + STR$(Key)
     END SUB

     SUB ClearFields
      Edit1.Text = ""
      Edit2.text = ""
      Edit3.Text = ""
     END SUB
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2023-2-9  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-09-14 07:43:40