Turn off calling tabPage_Enter method in C #
When I switch tabs with the following code
tabControl1.SelectTab("MyNextTab");
It calls tabPage_Enter for the tab it is switching from and the tab it is switching to. I want it to be called for the tab it switches to, but not the taboo it switches from. How would I disable this. I know when this happens, so if there was a call I could make it would disable the call to the input method for that tab that I could implement.
source to share
Yes, I repeat if I use the button to change the selected tab. The TabControl forces focus on itself before it changes the SelectedIndex. Apparently this was done to avoid problems with the Validating event. A focus change will result in the first Enter event, for the active tab, the tab will change and then fire a second Enter event.
Knowing this, you can set up an auxiliary boolean by specifying that the first Enter event should be ignored. Be careful to check that the current tab is not the one you want to select. In an ideal world, this behavior shouldn't matter. The focus has indeed moved to the active tab.
source to share