这位先生,您好!
您可以用下面一段代码实现当按下回车键时,active cell跳到下一行:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim im As 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)
End Sub
为了对Cell(0,4)进行Format,您可以使用FpSpread的EnterCell事件,在其事件处理器中对之处理;
您还可以设置FpSpread的EditModePermanent属性到True,使active cell 始终进入编辑状态。
一切顺利! |