menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SelectedIndexChangingEventArgs - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SelectedIndexChangingEventArgs

    Contains information about the SelectedIndexChanging event.

    Inheritance
    System.Object
    SelectedIndexChangingEventArgs
    Namespace: Syncfusion.Windows.Forms.Tools
    Assembly: Syncfusion.Tools.Windows.dll
    Syntax
    public class SelectedIndexChangingEventArgs : CancelEventArgs

    Constructors

    SelectedIndexChangingEventArgs(Int32)

    Creates a new instance of this class with the specifed parameters.

    Declaration
    public SelectedIndexChangingEventArgs(int newSelectedIndex)
    Parameters
    Type Name Description
    System.Int32 newSelectedIndex

    The new selected index that will be set.

    Properties

    NewSelectedIndex

    Returns the newly selected tab index that is going to be set in the tab control.

    Declaration
    public int NewSelectedIndex { get; }
    Property Value
    Type
    System.Int32
    Examples

    You can get access to the corresponding TabPageAdv using the TabPages property, as follows:

    private void tabControlAdv1_SelectedIndexChanging(object sender, Syncfusion.Windows.Forms.Tools.SelectedIndexChangingEventArgs args)
    {
    	TabPageAdv newPage = this.tabControlAdv1.TabPages[args.NewSelectedIndex];
    	if(newPage == this.tab1)
    	{
    		MessageBox.Show("Cannot select tab page 1");
    		args.Cancel = true;
    	}
    }
    Private  Sub tabControlAdv1_SelectedIndexChanging(ByVal sender As Object, ByVal args As Syncfusion.Windows.Forms.Tools.SelectedIndexChangingEventArgs)
    	Dim NewPage As TabPageAdv =  Me.tabControlAdv1.TabPages(args.NewSelectedIndex) 
    	If NewPage = Me.tab1 Then
    		MessageBox.Show("Cannot select tab page 1")
    		args.Cancel = True
    	End If
    End Sub
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved