SSTab Control Events

SiriusProjects
08-20-2009, 07:49 AM
Having a bit of a mind blank at the moment. Can anyone help with the following?

On The MouseDown event of the SSTab control, I have a message box that pops up to notify the user that changes will be lost if they switch to a new tab. If they click "No", I want the current tab to stay as is. The only problem is, it still fires the Click Event anyway and display the next tab. How do I stop the click event from firing?

kassyopeia
08-20-2009, 08:23 AM
You can't easily stop an event from occurring. And it looks like there isn't even an easy way to stop the control from switching tabs, as silly as that sounds. The standard way for VB controls to handle something like this would be a TabChange(ByRef Cancel As Boolean) event - you set the parameter to override the standard functionality. There doesn't seem to be anything like that here.
So, it looks like you'll have to work around the unwanted functionality. For example, you could just switch back to the previous tab after the change. Or, if you want something more elaborate, create one frame per tab, put the controls into the frames instead of onto the tabs, and use the _Click event to show and hide the frames as appropriate. More work, but gives you full control. :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum