Results 1 to 11 of 11

Thread: removing/adding tab BUG

  1. #1

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362

    removing/adding tab BUG

    Hi,

    I have an administrator form that contain 4 tabs. Depending of what privileges the user have the user have access to some tab.

    Here is the code that I use :

    VB Code:
    1. Dim strPrivileges As String = AvoirDroitUsager()
    2.         Me.tabAdmin.Controls().Remove(Me.TabPage1)
    3.         Me.tabAdmin.Controls().Remove(Me.TabPage2)
    4.         Me.tabAdmin.Controls().Remove(Me.TabPage3)
    5.         Me.tabAdmin.Controls().Remove(Me.TabPage4)
    6.  
    7.         If InStr(strPrivileges, "P") > 0 Then
    8.             Me.tabAdmin.Controls().Add(Me.TabPage1)
    9.             Me.tabAdmin.Controls().Add(Me.TabPage2)
    10.             Me.tabAdmin.Controls().Add(Me.TabPage3)
    11.             Me.tabAdmin.Controls().Add(Me.TabPage4)
    12.         Else
    13.             If InStr(strPrivileges, "A") > 0 Then
    14.                 Me.tabAdmin.Controls().Add(Me.TabPage4)
    15.             End If
    16.             If InStr(strPrivileges, "C") > 0 Then
    17.                 Me.tabAdmin.Controls().Add(Me.TabPage2)
    18.             End If
    19.  
    20.             If InStr(strPrivileges, "M") > 0 Then
    21.                 Me.tabAdmin.Controls().Add(Me.TabPage3)
    22.             End If
    23.         End If

    The problem is that I can't close the form since I have implemented that piece of code... why?

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Are you getting specific error ?

  3. #3
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    I dont think it has anything to do with that code... I even tried addign a tabpage and tried all the different privileges. I can close the form.
    What happens when you try to close the form.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362
    I receive no error, only that the form doesn't want to close.

  5. #5
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    It's a known bug, search the forum about it and you'll find the answers
    \m/\m/

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Are you closing the form with code or by the 'X' button ?

  7. #7

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362
    Originally posted by Pirate
    Are you closing the form with code or by the 'X' button ?
    Both doesn't close the form, with the 'x' and with the Me.Close()...

    The only thing I see it's maybe somewhere in the code I do load something in a textbox from the database and since I have removed the tab it might search this textbox ... but I haven't see any code that might do this

  8. #8

    Thread Starter
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362
    Originally posted by PT Exorcist
    It's a known bug, search the forum about it and you'll find the answers

    If it's a known bug why you do not help me with at least few keyword.... these kind of post aren't helping the community... but well...

  9. #9
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Are you doing any databinding on that form ?

  10. #10
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Originally posted by Daok
    I receive no error, only that the form doesn't want to close.
    If at the time I didnt have the time to search FOR YOU I at least said that if you searched you could find the bug, but it seems it is just not that important to you to solve it.

    @Pirate it has nothing to do with databinding, simply if you have panels that have controls inside it that have focus if you try to close the form it will not allow until it's the form which have the focus, or at least is some strange theory like this. Like i said before if you search the forum you'll find the answer
    \m/\m/

  11. #11
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    That's what I thought too but I suspected it's bound to a datasource or something and he never disconnected it . Anyway , this seem to be the most confusing bug though .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width