| Input for WinForms Task-Based Help > Adding a Drop-Down Form > Changing the Navigation in the Navigator |
To change the navigation in the Navigator, change Index like the following:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Private Sub c1DbNavigator1_BeforeAction(sender As Object, e As C1.Win.C1Input.NavigatorBeforeActionEventArgs)
If e.Button = C1.Win.C1Input.NavigatorButtonEnum.First Then
' Goto second record instead of the first
e.Index = 1
End If
' Go to the last row if user entered too large position
If e.Button = C1.Win.C1Input.NavigatorButtonEnum.Position AndAlso e.Cancel Then
e.Cancel = False
End If
End Sub
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
private void c1DbNavigator1_BeforeAction(object sender, C1.Win.C1Input.NavigatorBeforeActionEventArgs e)
{
if (e.Button == C1.Win.C1Input.NavigatorButtonEnum.First)
{
// Goto second record instead of the first
e.Index = 1;
}
// Go to the last row if user entered too large position
if (e.Button == C1.Win.C1Input.NavigatorButtonEnum.Position && e.Cancel)
{
e.Cancel = false;
}
}
|
|