PB在資料視窗裡實現EnterEnter鍵代替Tab鍵轉到下一行

tisnly發表於2007-12-24

首先,在local External Fucntions內新增引用function unsignedlong keybd_event(uint bVk,uint bScan,long dwFlags,long dwExtraInfo ) library 'user32.dll'

自定義一個函式ue_entotab

定義兩個引數:keycode型別 key和unsignedlong型別keyflags,然後Event ID選擇pbm_dwnkey,定義好後新增函式://響應鍵盤操作
CHOOSE CASE key
 CASE KeyEnter!
  send(handle(this),256,9,long(0,0)) 
   CASE KeyDownArrow! //,KeyRightArrow!
  keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  keybd_event ( 9, 0, 2, 0 ) // 釋放tab
      Return 1
   CASE KeyUpArrow!,KeyLeftArrow!
      keybd_event ( 16, 0, 0, 0 ) // 按下shift
    keybd_event ( 9, 0, 0 , 0 ) // 按下tab
      keybd_event ( 9, 0, 2, 0 ) // 釋放tab
    keybd_event ( 16, 0, 2, 0 ) // 釋放shift
      Return 1
END CHOOSE

 

相關文章