ycak47 你好,VB 代码如下:- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim im As New FarPoint.Win.Spread.InputMap()
- ' 取消Spread中Enter键的默认处理事件
- im = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused)
- im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.None)
- End Sub
- Private Sub FpSpread1_EditModeOn(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FpSpread1.EditModeOn
- Dim ge As FarPoint.Win.Spread.CellType.GeneralEditor = TryCast(FpSpread1.EditingControl, FarPoint.Win.Spread.CellType.GeneralEditor)
- If ge IsNot Nothing Then
- ' 添加编辑状态下的自定义事件
- AddHandler ge.KeyDown, AddressOf ge_KeyDown
- End If
- End Sub
- Private Sub ge_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
- System.Diagnostics.Debug.WriteLine("ge_KeyDown" & DateTime.Now.Millisecond.ToString())
- End Sub
复制代码 |