How to achieve in the DW by pressing left and right key to switch to adjacent cells:
First declare an external function:
Subroutine keybd_event (int bvk,int bscan,ulong dwflags,ulong dwextrainfo) LIBRARY "User32.dll"
First, if you do not want to use the cell in the DW to edit content, as long as one press the left and right key to switch to other cell words can:
The new Ue_key corresponds to the Pbm_dwnkey code as follows:
If key=keyleftarrow! Then
keybd_event (16,0,0,0)//Press the SHIFT key
keybd_event (9, 0,0,0)//Press down tab
keybd_event (9, 0,2,0)//Release tab
keybd_event (16,0,2,0)//Release SHIFT key
Return 1
ElseIf key=keyrightarrow! Then
keybd_event (9, 0,0,0)//Press down tab
keybd_event (9, 0,2,0)//Release tab
Return 1
End If
Second, if you also want to use the cell in the DW to edit content, only in empty or select all when the key to switch to other cells can be:
The new Ue_key corresponds to the Pbm_dwnkey code as follows:
Integer li_len,li_len_selected
Li_len=len (This.gettext ())
Li_len_selected=len (this. SelectedText ())
If not (IsNull (This.gettext ()) or this.gettext () = "" or li_len=li_len_selected) then return
If key=keyleftarrow! Then
keybd_event (16,0,0,0)//Press the SHIFT key
keybd_event (9, 0,0,0)//Press down tab
keybd_event (9, 0,2,0)//Release tab
keybd_event (16,0,2,0)//Release SHIFT key
Return 1
ElseIf key=keyrightarrow! Then
keybd_event (9, 0,0,0)//Press down tab
keybd_event (9, 0,2,0)//Release tab
Return 1
End If