Solved

Help with Scrolling SSTAB

Posted on 2001-09-09
10
655 Views
Last Modified: 2008-02-01
I have placed an SSTAB control on a form (MDI Child)

I have to place a scroll bar down one side - so that the user can scroll down past the buttom of the viewable area to see more information.

I have not a clue about how this should be done or even where to start

Pointers to example code ... code solutions etc get the points

MTIA

DarrinE
0
Comment
Question by:DarrinE
10 Comments
 
LVL 4

Expert Comment

by:RichW
ID: 6468507
What kind of container is your data sitting in on the SSTab?
0
 
LVL 17

Accepted Solution

by:
inthedark earned 200 total points
ID: 6468706
Set up 2 picture boxes:

Place picOuter on the SSTAB and place picInner inside picOuter.

Place all of your controls on picInner.

Set picOuter width and height to fit inside the SSTAB.

How it words:

By setting picInner.top= -1440 it will scroll up one inch.

Set your pics and vscroll up like this:

' get rid of borders at run time but keep for design time
' so you can see where the pciture boxes are
' make the diffeerent colours to aid design
' but at run time merge then into the same colour as the SSTAB

picInner.borderstyle=0
picOuter.borderstyle=0
picInner.BackColor=SSTAB.BackColor
picOuter.BackColor=picInner.BackColor


' This is an important line.
vscroll.max=picInner.scaleheight-picOuter.scaleheight
vscroll.largechange=picOuter.scaleheight
vscroll.value=0
picInner.move 0,0


' Now all you need to do is setup you scroll events:

sub vscroll_Change()
   call vscroll_Scroll
End Sub

Sub VScroll_Scroll()
   
    ' This is the code that makes it work.

    ' The folling code will change the poisition of
    ' picInner.Top making it more negative
    ' because vscroll.max has been setup so that it wont scroll up heigher than it needs to

    picInner.Top = - vscroll.value
End Sub

Hope this helps - please excuse any typos.
0
 
LVL 2

Author Comment

by:DarrinE
ID: 6469016
thanks for the tips guys

I have about 75 editboxes which will be placed on the SSTab - I take it I will have to place these on the Picture control (picInner ??)

0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6469135
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6469139
If you already have a form you can select all controls in one hit and cut and paste them into picInner.

Consider the following:

In development mode you want to be able to view as may controls as possible. So you want you SSTAB and picOuter to be as large as possible. You can move then picInner up and down within picOuter to edit the controls. In your formload event, resize and position SSTAB and picOuter to their required positions and  sizes.

Be aware that there are some bugs with SSTab which were only corrected by VB6 SP5.  If you changed the left property of an element the SSTAB display got screwed.

>I have about 75 editboxes which will be placed on the SSTab

With 75 edit boxes you are reaching then point where you should be considering not using textboxes for performance reasons - so it depends on the client's budget and you abillities - it is not so simple to do away with texboxes for $100,000 I can make 350 editboxes appear in less than half a second - if you need better performance it can be acheived.

Hope this helps..



0
 
LVL 17

Expert Comment

by:inthedark
ID: 6469149
I suspect that emoreau's execllent solution works well with a few controls but for raw speed you can't beat:
   
picInner.Top = - vscroll.value

instead of:

Private Sub ScrollControls()
Dim ctl As Control

    For Each ctl In Me.Controls
        'Check for controls that don't move
        If TypeOf ctl Is VScrollBar Or _
           ctl.Name = "cmdStay" _
        Then
            'do nothing
        Else
            ctl.Top = ctl.Top + OldScrollPos - VScroll1.Value
        End If
    Next
    OldScrollPos = VScroll1.Value
End Sub

Which potentially could be painfully slow with loads of controls. And also invloves 1600% more software.


0
 
LVL 2

Author Comment

by:DarrinE
ID: 6470366
many thanks for the assistance ....

tell me more about this 350 controls in under 1/2 a second I am ineterested in this ....
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6472047
I didn't say "controls", I said "editboxes", there is a subtle difference.

I will give you more details in a day or so.
0
 
LVL 2

Author Comment

by:DarrinE
ID: 6472344
hmmm... ok missed that
0
 
LVL 2

Author Comment

by:DarrinE
ID: 6473930
inthedark :

Please look for my question about scrolling into view

DarrinE
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need VBS version of Excel date conversion 4 70
VBA color chart bars 12 85
using Access 8 68
Notepad++ how to remove delimiter : from beggning of the line? 3 103
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question