Since there's been little traffic at KF.ORG, I'm posting here in hopes of an answer...

I'm working on a KF-Classic form that uses tabs. Each tab allows editing of a different set of data. When any object on a page is changed, it sets $MODIFIED to true. This is a Global var. It does this by calling a SetModified() UDF, either directly or via a primary UDF. (some controls enable others on the page, for example - clicking the RunSilent checkbox disables the controls related to the display format via an OnClickRunSilent() UDF. This UDF disables the related controls and then calls the SetModified() UDF.)

The $MODIFIED flag causes a warning dialog to display when exiting the application, allowing the user to save or discard the changes. What I'm trying to accomplish is preventing the selection of other tabs when unsaved data exists on the current tab instead of this pop-up dialog box. When I try using
 Code:
$tabPAGE2.Enable = 0
it disables the objects on that tab, but does not prevent that tab from being selected. I know that the .Visible control isn't supported on TabPages, but I'd really like a simple solution to lock a user to a specific tab once they've modified data on that tab.

I'm trying to avoid something like
 Code:
$tabTabControl.OnSelectedIndexChanged = 'OnTabChange()'
Function OnTabChange()
  If $MODIFIED   ; don't allow tab changes
    $tabTabControl.SelectedIndex = $ACTIVETAB
  EndIf
  Exit 0
EndFunction
$MODIFIED and $ACTIVETAB are set when any data object is modified. This would work, and in production I'd flash the background of the MODIFIED message in the status bar, but this allows the alternate tab to be selected momentarily before focus is restored to the tab with modified data. The result isn't pretty and is downright distracting.

Thanks,

Glenn
_________________________
Actually I am a Rocket Scientist! \:D