Windows.Forms.TabControl changing SelectedIndex upon focus

35 Views Asked by At

I am using the tabcontrol with 4 tabs. The tab is not in focus but tab 0 is displayed. When I click on a button on tab0, the GotFocus event shows the SelectedIndex as 0 .. as I would expect. But then the tabControl.Selecting event is triggered. In this event the SelectedIndex is now 4, the last tab.

What is changing the Index?? Again, I am just clicking on a button that is on Tab 0. The event of that button is not triggered.

I would expect the tab index to stay at 0 on the return focus and the button click event to be triggered.

0

There are 0 best solutions below