dreamweaver|单元格|光标
问题描述:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 如何在DW中按下左右光标时切换到相邻单元格? 解决方案: 首先声明外部函数:
Subroutine keybd_event(int bVk,int bScan,ulong dwFlags,ulong dwExtraInfo) LIBRARY "user32.dll"
一、如果不想在DW的单元格内利用左右键编辑内容,只要一按下左右键就切换到其他单元格的话可以:
新建ue_key 对应 pbm_dwnkey ,代码如下:
if key=keyleftarrow! then 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 elseif key=keyrightarrow! then keybd_event(9 ,0,0,0) //按下下TAB
keybd_event(9 ,0,2,0) //放开TAB键
return 1 end if
二、如果还想在DW的单元格内利用左右键编辑内容,只在空或者全选时按下左右键才切换到其他单元格的话可以:
新建ue_key 对应 pbm_dwnkey ,代码如下:
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) //按下SHIFT键 keybd_event(9 ,0,0,0) //按下下TAB
keybd_event(9 ,0,2,0) //放开TAB键
keybd_event(16,0,2,0) //放开SHIFT键 return 1 elseif key=keyrightarrow! then keybd_event(9 ,0,0,0) //按下下TAB
keybd_event(9 ,0,2,0) //放开TAB键
return 1 end if