It is standard UI functionality that if you show a Tab, user's can click on it. You will confuse your users by making the Tab visible but not allowing them to use it.
Depending on the control, you can usually trap the Tab click and Tab mouseup/mousedown events. Keep track of the currently selected Tab index that is valid. Subsequent attempts to change tabs via the click event or mouse events should call a method that determines whether you want to allow the change or not. If not, reset the selected Tab index to your last valid Tab index.