可以根据您的业务设置inputmap,或者自定义一个粘贴的action
- // Create an InputMap object.
- FarPoint.Win.Spread.InputMap inputmap1;
- // Assign the InputMap object to the existing map.
- inputmap1 = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
- // Map the Enter key.
- inputmap1.Put(new FarPoint.Win.Spread.Keystroke(Keys.V, Keys.Control), FarPoint.Win.Spread.SpreadActions.None);
- // Create another InputMap object.
- FarPoint.Win.Spread.InputMap inputmap2;
- // Assign this InputMap object to the existing map.
- inputmap2 = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
- // Map the Enter key.
- inputmap2.Put(new FarPoint.Win.Spread.Keystroke(Keys.V, Keys.Control), FarPoint.Win.Spread.SpreadActions.None);
复制代码
- private void button1_Click(object sender, EventArgs e)
- {
- // Create an InputMap object.
- FarPoint.Win.Spread.InputMap inputmap1;
- // Assign the InputMap object to the existing map.
- inputmap1 = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
- // Map the Enter key.
- inputmap1.Put(new FarPoint.Win.Spread.Keystroke(Keys.V, Keys.Control), FarPoint.Win.Spread.SpreadActions.ClipboardPasteAll);
- // Create another InputMap object.
- FarPoint.Win.Spread.InputMap inputmap2;
- // Assign this InputMap object to the existing map.
- inputmap2 = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
- // Map the Enter key.
- inputmap2.Put(new FarPoint.Win.Spread.Keystroke(Keys.V, Keys.Control), FarPoint.Win.Spread.SpreadActions.ClipboardPasteAll);
- }
复制代码 |