找回密码
 立即注册

QQ登录

只需一步,快速开始

merry_jing

中级会员

4

主题

13

帖子

846

积分

中级会员

积分
846

活字格认证

merry_jing
中级会员   /  发表于:2012-3-26 16:36  /   查看:6447  /  回复:6
客户要求在Spread中用上下左右箭头来移动光标,不能用Tab键来移动光标,请问如何设定?
另外,在Spread中按下Enter键时必须将光标垂直下移,请问如何设定?

6 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2012-3-26 16:57:00
沙发

回复 1# merry_jing 的帖子

你好 merry_jing ,
在随机帮助文档中->Developer's Guide->Managing Keyboard Interaction->Changing the Default Keyboard Map 中有详细的说明 和 代码,请参考。
回复 使用道具 举报
merry_jing
中级会员   /  发表于:2012-3-26 18:42:00
板凳
只要以上两种情况可以在SPREAD中实现就可以,我们再深入研究一下。谢谢!
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-3-27 09:11:00
地板

回复 3# merry_jing 的帖子

merry_jing 你好,文档中的代码我做了修改,实现了以上功能,请参考:

  1.    FarPoint.Win.Spread.InputMap im = new FarPoint.Win.Spread.InputMap();

  2.            //更改 Enter 键默认值
  3.             im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
  4.             im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);

  5.             im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
  6.             im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);

  7.             //更改 Up 键默认值,left、right、down 键设置方法相同
  8.             im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
  9.             im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Up, Keys.None), FarPoint.Win.Spread.SpreadActions.None);


  10.             im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
  11.             im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Up, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
复制代码
回复 使用道具 举报
merry_jing
中级会员   /  发表于:2012-3-27 10:49:00
5#
谢谢,我参考一下。
回复 使用道具 举报
merry_jing
中级会员   /  发表于:2012-3-27 11:09:00
6#
为了实现以上功能而增加了以下代码,仅供大家参考!
    function keydown() {
        if (window.event.keyCode == 9) {
            window.event.keyCode = 13
            return;
        }
        if (window.event.keyCode == 13) {
         window.event.keyCode=40;
        }
    }
    document.onkeydown = keydown;
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2012-3-27 11:33:00
7#

回复 6# merry_jing 的帖子

merry_jing 你好:

1. 感谢把解决方案反馈给我们。

2. 请问楼主使用的是 Spread for ASP.NET 版本产品吧?我们提倡到相应板块发帖,有利于我们获取用户的版本信息,我会把该贴移动到相应板块。感谢楼主的配合。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部