又遇到一个问题,请大家帮忙

眼科医生 2011-09-25 08:44:52
在文本框中keypress事件中添加如下代码
if (nkeycode=13)
thisform.sele_list_1&&为销售单填充数据
this.SetFocus
endif

该文本框不能获得焦点。

if (nkeycode=13)
this.SetFocus
endif

这样也不行
...全文
131 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
WWWWA 2011-09-26
  • 打赏
  • 举报
回复
if (nkeycode=13)
this.SetFocus
Nodefault
endif
taohua300 2011-09-26
  • 打赏
  • 举报
回复
if (nkeycode=13)
thisform.sele_list_1&&为销售单填充数据
this.SetFocus
Nodefault
endif
sun8330 2011-09-25
  • 打赏
  • 举报
回复
如果要实现本控件不失焦点,应该用valid事件,而不应该用keypress,可以这样写:

text1.valid
if not empty(this.value)
thisform.sele_list_1
return 0
endif

2,749

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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