The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
When using a TabControlAdv, we allow the user to select a tab. We perform some other actions when the user selects a tab. Also, we sometimes programmatically select a tab. When that happens, we need different things to happen than when a user clicks on a tab (and, also, we don't want an infinite loop).
Is there a way to tell the difference between having a user select a new tab and changing a selected tab programmatically? I've been using the SelectedIndexChanging event to catch when the user selects a new tab, but that means I have to keep disabling and enabling the event handler when I programmatically change the tab.
RBRajasekar B Syncfusion Team March 1, 2010 11:55 AM UTC
Hi,
In SelectedIndexChanged event,you can find whether the tab is selected by mouse or through code using the below workaround:
int i = this.tabControlAdv1.Renderer.HitTestTabs(this.tabControlAdv1.PointToClient(MousePosition), false);
This will return selected index. If the value of i is -1 then it indicates it is selected through code. If it returns exact selected index then it is selected by mouse.