Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent User from choosing a tab
Message
From
14/11/2007 14:15:22
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
14/11/2007 10:24:38
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01265436
Message ID:
01268953
Views:
6
Hi Tony,

Another thing I had done once was to put a control over the top of the tab to hide it. I sent it to the back when I wanted the user to have access. The control was not visible to the user so they couldn't tell it was there, but the tab showed up when they were granted access. It looked good, but seemed kind of hookey but it was real easy. I do wish MS would enhance the tab control to be more flexible as it is a nice control for lots of things.
Tim

>Since the tab control was giving me so much trouble with its events, I found another solution to the problem of preventing a user from clicking on another tab before they click on the 'Save' button.
>
>It seems that the tab page's 'Enter' event will work:
>
>  Private Sub LineItemEntry_Enter(ByVal sender As System.Object, _
>      ByVal e As System.EventArgs) Handles LineItemEntry.Enter
>    If (Me.glEditable And Not Me.glAdding) Or Me.glSaved = True _
>        Or Me.chkPOComplete.Checked Then
>      'Set up the LineItemEntry page
>      SetTypeReqLabels()
>    Else
>      'Skip back to the previous page
>      Me.TabControl.SelectedTab = Me.PropertiesPage
>      MsgBox("Please click on the  [ Save Req ]  button first", _
>        MsgBoxStyle.OkOnly, "Notice")
>    End If
>  End Sub
>
>
>Hope this helps someone.
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform