merry_jing 你好,文档中的代码我做了修改,实现了以上功能,请参考:
- FarPoint.Win.Spread.InputMap im = new FarPoint.Win.Spread.InputMap();
- //更改 Enter 键默认值
- im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
- im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);
-
- im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
- im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);
- //更改 Up 键默认值,left、right、down 键设置方法相同
- im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
- im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Up, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
- im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
- im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Up, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
复制代码 |