如果要得到Spread中上、下、左、右的KeyDown事件,需要使用下面的代码:- private void Form1_Load(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.InputMap im = new FarPoint.Win.Spread.InputMap();
- im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
- im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Down, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
- im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
- im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Down, Keys.None), FarPoint.Win.Spread.SpreadActions.None);
- }
- protected override bool ProcessDialogKey(Keys keyData)
- {
- switch (keyData)
- {
- case Keys.Up:
- case Keys.Down:
- return false;
- }
- return base.ProcessDialogKey(keyData);
- }
- private void fpSpread1_KeyDown(object sender, KeyEventArgs e)
- {
- }
复制代码 |