Yanai, Just handle the PreviewMouseLeftButtonDown event for the TabControl. Then check if the Source of the RoutedEvent is a TabItem. Perform your testing to see if you want to cancel the event and if so use, e.Handled = True to handle the event which will cancel the tab page switching.
Private Sub tcPages_PreviewMouseLeftButtonDown(ByVal sender As Object, _
ByVal e As System.Windows.Input.MouseButtonEventArgs) _
Handles tcPages.PreviewMouseLeftButtonDown
If TypeOf e.Source Is TabItem Then
'perform your test here
'if you want to keep editing then use this code
e.Handled = True
End If
End Sub
Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile
Just a grain of sand on the worlds beaches.