默认情况下,Enter是切换cell编辑状态的。
Spread提供默认的Keyboard Map,如果你需要改变它,可以参考下面的示例:
- private void Form1_Load(object sender, System.EventArgs e)
- {
- FarPoint.Win.Spread.InputMap im = new FarPoint.Win.Spread.InputMap();
- // Define the operation of pressing Enter key in cells not being edited as "Move to the next row".
- im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
- im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);
- // Define the operation of pressing Enter key in cells being edited as "Move to the next row".
- im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
- im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);
- }
复制代码 |