发信人: gold_dragon()
整理人: leitiger(2002-06-05 23:47:38), 站内信件
|
【 在 gzfxh (华仔) 的大作中提到: 】 : 一个DW中已RETRIEVE多条记录,修改其中 : 某条记录,但一回车或按上下键光标就 : 移到下一条记录请问如何解决不让光标下移。
如果你仅仅是想不让光标往下移 1、在数据窗口里定义一个用户事件如keydown,事件的id为pbm_dwnkey 2、在keydown事件里编写script如下: long cur_row cur_row=this.getrow() if key=keyenter! or key=keydownarrow! then if cur_row=1 then this.setrow(1) else this.setrow(cur_row -1) end if end if if key=keyuparrow! then if cur_row=1 then this.setrow(1) else this.setrow(cur_row+1) end if end if
如果你希望按回车、上移键、下移键则跳到下一个字段就简单多了 只须在script这么写就行了。
if key=keyenter! or key=keydownarrow! or key=keyuparrow! then send(handle(this),256,9,0) //发送一个tab键消息 end if
-- ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.96.79.132]
发信人: gold_dragon (雷龙), 信区: Powerbuilder 标 题: Re: 雷兄,解决不让光标下移不成功 发信站: 网易虚拟社区 (Sun May 16 14:13:15 1999), 站内信件
【 在 gzfxh (华仔) 的大作中提到: 】 : : 还是下移,不能解决.多问一句,事件的事件ID有什么用, : 每自定义一个事件是否对要对应一个ID,但里面的ID这 : 么多怎么知道其意思。 : .......
你再试试这个,不用用户自定义事件了,嘿嘿 在datawindow的rowfocuschanged事件里编写script如下:
if keydown(keyenter!) or keydown(keydownarrow!) then this.setrow(currentrow -1) end if if keydown(keyuparrow!) then this.setrow(currentrow +1)
-- ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.96.79.132]
|
|