屏蔽回车

tiantianxiaoqiang 2009-12-29 01:37:03
当用户按下回车时,其实电脑认为是空格,在keydown里怎样处理?
...全文
165 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuxg1981 2010-01-06
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 sun1976 的回复:]
莫非你是想把回车换成空格?如果是的话你就在倒数第三行加工一下就行了
不至于者都不会变通吧
string ls_1
ls_1=right(text,2)
if ls_1='~r~n' then
text=mid(text,1,len(text) -2) +  ' '//这句
selecttext(len(text)+1,0)
end if
[/Quote]
12樓的應該可以!
sunfor 2010-01-06
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 tiantianxiaoqiang 的回复:]
试了,还是不行无比郁闷中
[/Quote]
人家教你,就不要说这种话了!!!!!!!
sun1976 2010-01-04
  • 打赏
  • 举报
回复
莫非你是想把回车换成空格?如果是的话你就在倒数第三行加工一下就行了
不至于者都不会变通吧
string ls_1
ls_1=right(text,2)
if ls_1='~r~n' then
text=mid(text,1,len(text) -2) + ' '//这句
selecttext(len(text)+1,0)
end if
sun1976 2010-01-04
  • 打赏
  • 举报
回复
你想要什么样的效果?
4楼回复的方法,你按回车肯定不会把回车符保存到你的mle里的
也就是回车后和没按回车的结果一样
还要怎么样才算屏蔽回车呢?
不是导演李安 2010-01-04
  • 打赏
  • 举报
回复
Mark~
tiantianxiaoqiang 2010-01-02
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 sun1976 的回复:]
自定义事件,事件id选pbm_enchange
string ls_1
ls_1=right(text,2)
if ls_1='~r~n' then
text=mid(text,1,len(text) -2)
selecttext(len(text)+1,0)
end if

[/Quote]
试了,还是不行无比郁闷中
qzyuanmu 2009-12-31
  • 打赏
  • 举报
回复
支持4楼
hxbkkk 2009-12-30
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 sun1976 的回复:]
自定义事件,事件id选pbm_enchange
string ls_1
ls_1=right(text,2)
if ls_1='~r~n' then
text=mid(text,1,len(text) -2)
selecttext(len(text)+1,0)
end if

[/Quote]这个强,试下
sun1976 2009-12-30
  • 打赏
  • 举报
回复
自定义事件,事件id选pbm_enchange
string ls_1
ls_1=right(text,2)
if ls_1='~r~n' then
text=mid(text,1,len(text) -2)
selecttext(len(text)+1,0)
end if
jlwei888 2009-12-30
  • 打赏
  • 举报
回复
这mle中确实是无效,别的中好使!

但在mle中回车就换行啊!
永生天地 2009-12-30
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 sun1976 的回复:]
自定义事件,事件id选pbm_enchange
string ls_1
ls_1=right(text,2)
if ls_1='~r~n' then
text=mid(text,1,len(text) -2)
selecttext(len(text)+1,0)
end if

[/Quote]
顶一个
tiantianxiaoqiang 2009-12-30
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 jlwei888 的回复:]
这mle中确实是无效,别的中好使!

但在mle中回车就换行啊!
[/Quote]
我试了,是回车,我用setprofilestring写到ini里,看到的确实是回车
tiantianxiaoqiang 2009-12-29
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 jlwei888 的回复:]
if KeyDown(KeyEnter!) THEN

return 1
end if
[/Quote]
不行啊,我用的是mle,我看key帮助里是renturn 是这样写的
1 Do not process the key (RichTextEdit controls only)
还有没有其他的办法了?

jlwei888 2009-12-29
  • 打赏
  • 举报
回复
if KeyDown(KeyEnter!) THEN

return 1
end if

740

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 脚本语言
社区管理员
  • 脚本语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧