We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Capture Close Tab Button Event

The change index event fire when the Close Tab Button is clicked and that creates unwanted behaviors for my application. How can I catch a Close Tab Button event before ChangeIndexEvent. Or how can I detect in the ChangeIndexEvent that the Close Tab Button has been clicked and the user didn't click the tab?


1 Reply

BA BagavathiPerumal Apranandham Syncfusion Team March 6, 2023 08:31 AM UTC

Hi Ola Mallaug,



We suggest you to use the Closing event of TabPageAdv to achieve your requirement. The Closing event will be fired before the SelectedIndexChanged event, using this you can detect whether the SelectedIndexChanged event is fired due to closing the tab or selecting the tab. Please refer to the below documentation for your reference.


UG Documentation: https://help.syncfusion.com/windowsforms/tabcontrol/events?cs-save-lang=1&cs-lang=csharp#closing-event



Regards,
Bagavathi Perumal A


Loader.
Live Chat Icon For mobile
Up arrow icon