Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 26, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Catch Every TabStrip Click Event

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 
	End If
End 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.

Matt Hart
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date