sstab control - resizing during runtime problem 
Author Message
 sstab control - resizing during runtime problem

I am using the SSTab control (SR2) in a Visual Basic application.  I have
been very pleased with its performance during design time.  It really makes
things easier when you have a lot of tabs and control elements on a form.  

But,  I am having problems with the control during runtime.  Whenever I try
to change any properties on any of the elements "contained" within the
SSTab control [during run-time],  the elements appear to lose there
relationship to their parent SSTab control and come to the front.  This is
obviously not a good thing,  and I was wondering if anyone knows if there
is a patch or something that would fix this bad behavior?  Any comments or
suggestions would be greatly appreciated.



Wed, 07 Mar 2001 03:00:00 GMT  
 sstab control - resizing during runtime problem

Quote:

>I am using the SSTab control (SR2) in a visual basic application.  I have
>been very pleased with its performance during design time.  It really makes
>things easier when you have a lot of tabs and control elements on a form.

>But,  I am having problems with the control during runtime.  Whenever I try
>to change any properties on any of the elements "contained" within the
>SSTab control [during run-time],  the elements appear to lose there
>relationship to their parent SSTab control and come to the front.  This is
>obviously not a good thing,  and I was wondering if anyone knows if there
>is a patch or something that would fix this bad behavior?  Any comments or
>suggestions would be greatly appreciated.

Try to resize only the tab that is currently visible.
I.E.

Private Sub Form_Resize()

    ' Resize only the current tab
    Select Case SomeTab.Tab
    Case 0
        ' Resize Tab 0
    Case 1
        ' Resize Tab 1
    Case 2
        ' Resize Tab 2
    Case 3
        ' Resize Tab 3
    Case 4
        ' Resize Tab 4
    End Select
End Sub

Then when the user selects a tab in the Tab click event:

Private Sub SomeTab_Click(PreviousTab As Integer)

    ' tell we changed tab
    Form_Resize
End Sub

Hopefully that will help, or at least a variation on it.
--
Steven McGovern
Healthmaster, Inc.

Unsolicited commercial/propaganda email subject to legal action.
Under US Code Title 47, Sec.227(a)(2)(B), Sec.227(b)(1)(C), and
Sec.227(b)(3)(C), a State may impose a fine of not less than $500
per message.  See http://www.law.cornell.edu/uscode/47/227.html



Fri, 09 Mar 2001 03:00:00 GMT  
 sstab control - resizing during runtime problem
I've found other problems with SSTab/SSPanel.  Is there a binary update?

Dennis.



Sat, 10 Mar 2001 03:00:00 GMT  
 sstab control - resizing during runtime problem
Garry,

Can't see your original post but following on from Steven's response, I
would suggest that in your resizing code you check that the.left property of
a control is not large and negative (say less than -1000).  If it is, ignore
it during resize.  For reasons that remain shrouded in the mists of time,
the designers of the SSTab control move items off the active tab by moving
them "left" by a large amount.  If your resize method changes the .left
property of a control it will "pop-up" on the currently active tab - where
it has no right to be!

Obviously a consequence of this is that you will need to call your resizing
code when the user changes the current tab (as the hidden controls will not
have been resized)!

HTH

Peter



Sat, 10 Mar 2001 03:00:00 GMT  
 sstab control - resizing during runtime problem

Quote:

> I am using the SSTab control (SR2) in a visual basic application.  I have
> been very pleased with its performance during design time.  It really makes
> things easier when you have a lot of tabs and control elements on a form.

> But,  I am having problems with the control during runtime.  Whenever I try
> to change any properties on any of the elements "contained" within the
> SSTab control [during run-time],  the elements appear to lose there
> relationship to their parent SSTab control and come to the front.  This is
> obviously not a good thing,  and I was wondering if anyone knows if there
> is a patch or something that would fix this bad behavior?  Any comments or
> suggestions would be greatly appreciated.

I use the sstab control extensively. I call the attached subroutine
from the sstab Click event based on MS KB article Q154885, and I
have no problems.

[ TAB.TXT 1K ]
Public Function gnProcessTabClick(rsstTab As SSTab, PreviousTab As Integer) As Integer
' Process Click event of SSTab control

    Const nINITIAL_TAB = 0          'tab 0 is first tab to be displayed
    Dim sMsg As String
    Dim ctrControl As Control

    With rsstTab
        ' If called from Form_Load event to initialize the tab message array ...
        If PreviousTab < 0 Then
            ' Return initial tab number
            gnProcessTabClick = nINITIAL_TAB
            Exit Function           'initialization complete
        End If
        ' Return the current tab number
        gnProcessTabClick = .Tab
    End With

    'Prevent controls not on current tab from remaining in tab order
    'Ref: Microsoft KB article Q154885
    On Error Resume Next    'not all controls have Container or TabStop properties
    For Each ctrControl In rsstTab.Parent.Controls  'enumerate all controls on form
        With ctrControl
            If TypeOf .Container Is SSTab Then
                ' If controls are inside a frame control, they are not contained
                ' by the SSTab. By disabling the the frame, the controls inside
                ' are effectively removed from the tab order.
                If TypeOf ctrControl Is Frame Then
                    ' Left=Left-75000 if not on current tab
                    .Enabled = .Left > 0
                Else
                    .TabStop = .Left > 0
                End If
            End If
        End With
    Next
    On Error GoTo 0

End Function



Tue, 13 Mar 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Resizing a control with the mouse during runtime

2. resizing a form when a control resizes during execution

3. resizing a form when a control resizes during execution

4. SStab disappearing during Runtime

5. Problem With SSTAB-Control if resize

6. Problem With SSTAB-Control if resize

7. resizing combo box during runtime

8. resize image in MSFlexGrid during runtime?

9. PROBLEM: getting a new control in front of others during runtime

10. Resizing controls on SSTab causes some controls to always appear on top

11. sstab-resize-problem

12. SSTab, Command buttons, and resizing problem

 

 
Powered by phpBB® Forum Software