回复 1楼jarodma的帖子
屏蔽 Ctrl + X 快捷键行为方法如下:
- private void Form1_Load(object sender, EventArgs e)
- {
- 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.X, 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.X, Keys.Control), FarPoint.Win.Spread.SpreadActions.None);
- }
复制代码
或者是不希望剪切列标题?可以通过以下代码设置:
- this.fpSpread1.Sheets[0].Columns[0].Label = "test";
- this.fpSpread1.ClipboardOptions = FarPoint.Win.Spread.ClipboardOptions.NoHeaders;
复制代码 |