Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / FpSpread Class / Advance Event
Example


In This Topic
    Advance Event (FpSpread)
    In This Topic
    Occurs when the user tries to advance from the first or last row in Spread.
    Syntax
    'Declaration
     
    Public Event Advance As AdvanceEventHandler
    'Usage
     
    Dim instance As FpSpread
    Dim handler As AdvanceEventHandler
     
    AddHandler instance.Advance, handler
    public event AdvanceEventHandler Advance
    Event Data

    The event handler receives an argument of type AdvanceEventArgs containing data related to this event. The following AdvanceEventArgs properties provide information specific to this event.

    PropertyDescription
    Gets whether to move to the next component.  
    Gets or sets whether to cancel default processing.  
    Remarks

    This event occurs when the user moves the focus to the next or previous component on the form. This event occurs when the user performs one of the following actions:

    • Presses the Tab key when the focus is in the lower-right (last) cell
    • Presses Shift+Tab when the focus is in the upper-left (first) cell
    • Presses the down arrow key when the focus is in the bottom (last) row
    • Presses the up arrow key when the focus is in the top (first) row
    • Presses the left arrow key when the focus is in the leftmost column of a row
    • Presses the right arrow key when the focus is in the rightmost column of a row

    The application responds by moving the focus to the next or previous component on the form.

    This works as long as you have not overridden the default behavior of the Tab key. For more information on defining the Tab key, refer to information on the InputMap and action keys.

    This event is raised by the OnAdvance method when the focus is advancing to the next item.

    For more details on the individual event arguments, refer to AdvanceEventArgs members.

    Example
    This example raises the Advance event when the user presses the up arrow key and the focus is in the first row.
    private void fpSpread1_Advance(object sender, FarPoint.Win.Spread.AdvanceEventArgs e)
    {
         ListBox1.Items.Add("Advance event fired!");
    }
    
    Label1.Text = "Click on a cell in the first row and press the UP arrow key."
    Private Sub FpSpread1_Advance(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.AdvanceEventArgs) Handles FpSpread1.Advance
         ListBox1.Items.Add("Advance event fired!")
    End Sub
    
    Label1.Text = "Click on a cell in the first row and press the UP arrow key."
    See Also