Spread Windows Forms 6.0 Product Documentation
Advance Event
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : Advance Event


Glossary Item Box

Occurs when the user tries to advance from first or last row in Spread.

Syntax

Visual Basic (Declaration) 
Public Event Advance As AdvanceEventHandler
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim handler As AdvanceEventHandler
 
AddHandler instance.Advance, handler
C# 
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
AdvanceNext Gets whether to move to the next component.
Cancel 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.
C#Copy Code
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."
Visual BasicCopy Code
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."

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.