You might have noticed that if you click on a TabStrip tab, then move the mouse pointer until it’s no longer over the TabStrip without releasing the mouse button, the Click event doesn’t fire even though the tab is changed. To detect this behavior, use this code:
Private Sub TabStrip1_MouseUp(Button As Integer, _ Shift As Integer, X As Single, Y As Single) If X < 0 Or X > TabStrip1.Width Or _ Y < 0 Or Y > TabStrip1.Height Then TabStrip1_Click End IfEnd Sub
This calls the Click event code if you do not release the mouse button above the TabStrip. You can’t just put the Click handling code in the MouseUp event because then keyboard tab changes wouldn’t work.