我的表格控件,一共有7列,其中第二列和第四列是设定锁定的,在回车事件设置的是移动到下一个单元格,我现在光标在第一列中,我怎么才能按回车,让光标直接跳到第三列而不是第二列?请问如何控制??谢谢了。。

解决方案 »

  1.   

    用.SetActiveCell col,row 方法。
      

  2.   

    先让farpoint spread 捕捉到焦点;
    col和row是你要跳到的位置;
    不明白再问!~
      

  3.   

    Private Sub Form_Load()
        vaSpread1.EditEnterAction = 5
    End SubPrivate Sub vaSpread1_LeaveCell(ByVal Col As Long, ByVal Row As Long, ByVal NewCol As Long, ByVal NewRow As Long, Cancel As Boolean)
        With Me.vaSpread1
           
            .Col = NewCol
            .Row = NewRow
            If .Lock = True Then
               SendKeys "{Enter}"
            End If
        End With
    End Sub
      

  4.   

    0 - None (Default) Active cell does not change SS_CELL_EDITMODE_EXIT_NONE
    1 - Up Active cell moves up SS_CELL_EDITMODE_EXIT_UP
    2 - Down Active cell moves down SS_CELL_EDITMODE_EXIT_DOWN
    3 - Left Active cell moves left SS_CELL_EDITMODE_EXIT_LEFT
    4 - Right Active cell moves right SS_CELL_EDITMODE_EXIT_RIGHT
    5 - Next Next cell becomes active cell
    (Active cell moves in the order left to right, top to bottom.) SS_CELL_EDITMODE_EXIT_NEXT
    6 - Previous Previous cell becomes active cell
    (Active cell moves in the order right to left, bottom to top.) SS_CELL_EDITMODE_EXIT_PREVIOUS
    7 - Same Current cell remains active cell SS_CELL_EDITMODE_EXIT_SAME
    8 - Next Row Active cell moves to first column of next row SS_CELL_EDITMODE_EXIT_NEXTROW