Link to home
Start Free TrialLog in
Avatar of jackjohnson44
jackjohnson44

asked on

sstab vb

I have a project and depending on a login, I hide some tabs on an sstab
        SSTab1.TabVisible(1) = False

for some reason when I do this, there is a white block where the missing tab was.

How do I prevent this.

The underlying form is grey, the correct color.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of abdulhameeds
abdulhameeds
Flag of Saudi Arabia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pradapkumar
pradapkumar

I tried you code snippet in my machine. But it works fine. Then y u wish to change your program? First try to install Service pack 6 for vs 6. then try the same thing.
I tested the sstab1's tabvisible property with the following code snippet

Private Sub Command1_Click()
    Static i As Integer
    SSTab1.TabVisible(i) = False
    i = i + 1
End Sub


The above program works fine.
Pradap Kumar
dear pradapkumar i think you missed the point
the problem will not appear to you unless you change the form background
then you will notice the missing blank tab

so the answer as i said before he can make the number of tabs preview equal to the number of visible tabs
or chnage the backgroung of sstab to same color of the form background

best regards
Mostafa_Lotfy55
I missed to edit your snippise code

then your solution is one of two

1- The First solution

Private Sub Command1_Click()
  Static i As Integer
    If i >= SSTab1.Tabs Then Exit Sub        // to be sure ther's no run time error
    SSTab1.TabVisible(i) = False                 // Hide The Tab number i
    i = i + 1                                              
    SSTab1.BackColor = Me.BackColor
End Sub


2- the second solution

Private Sub Command2_Click()
SSTab1.TabVisible(1) = False
If SSTab1.TabsPerRow <= 1 Then Exit Sub
SSTab1.TabsPerRow = SSTab1.TabsPerRow - 1  
End Sub

I hope that solve your prblem  jackjohnson44
best regards
Mostafa_Lotfy55
Dear Mostafa

Yes the problem comes when the form's background changed. But that blank box is appearing when all the tabs were changed as invisible.
dear pradapkumar
in case that all your tabs are invisible
then make the control itself SSTab invisible as follow

SSTab1.Visible = False