首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > VFP >

如其使grid回车后,command 获得焦点

2013-01-17 
如果使grid回车后,command 获得焦点?求教![解决办法]方法1:将 Grid 的 ColumnCount 设为大于0,然后在 Grid

如果使grid回车后,command 获得焦点?
求教!
[解决办法]

方法1:
将 Grid 的 ColumnCount 设为大于0,然后在 Grid 每列的 text1 控件的 keypress 事件加代码Lparameters nKeyCode, nShiftAltCtrl
If nKeyCode=13
*Nodefault
Thisform.Command1.SetFocus
Endif
-------------------------
方法2: vfp8.0、9.0
新建一个按钮,如 Command100,其 Visible 属性为 .F.,其 Click 事件代码为:
Lparameters nKeyCode, nShiftAltCtrl
If nKeyCode=13
*Nodefault
Thisform.Command1.SetFocus
Endif

然后表单的 Init 事件加代码:
With Thisform.Grid1
For lnI=1 To .ColumnCount
=Bindevent(.Columns(lnI).Text1,'KeyPress',Thisform.Command100,'Click')
Endfor
Endwith

热点排行