Does any one knows how to code the form to scroll? Do I need to add a scroll bar on the form and how can I make the scroll bar to scroll when I make the form smaller and larger?
Notice you can change the .Min and .Max properties of VScroll1, use this to your advantage instead of trying to play with erroneous numbers. This also goes for progress bars, BTW.
Good luck!
-Mike Difference between a madman and a genius:
A madman uses his genius destructively,
A genius uses his madness constructively.
copy the blue text and save it as a .FRM file
add it to a blank project as an existing form.
I used similar on a scrolling splash screen, maybe it will give you the idea you need. I have also incorporated the resize of the form/frame. Whatever size you state the form to be the scrollbar, which is not really necesary, will stick to the right and fill the height and the frame will fill the width.
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3150
ClientLeft = 60
ClientTop = 345
ClientWidth = 3510
LinkTopic = "Form1"
ScaleHeight = 3150
ScaleWidth = 3510
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
Caption = "Frame1"
Height = 3255
Left = 0
TabIndex = 1
Top = 3240
Width = 3135
End
Begin VB.Timer Timer1
Interval = 100
Left = 0
Top = 0
End
Begin VB.VScrollBar VScroll1
Height = 3135
Left = 3240
Max = 100
TabIndex = 0
Top = 0
Width = 255
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
VScroll1.Top = 0
VScroll1.Left = Form1.Width - 380
VScroll1.Height = Form1.Height - 400
Frame1.Width = Form1.Width - 500
End Sub
Private Sub Form_Resize()
VScroll1.Top = 0
VScroll1.Left = Form1.Width - 380
VScroll1.Height = Form1.Height - 400
Frame1.Width = Form1.Width - 500
End Sub
Private Sub Timer1_Timer()
If VScroll1.Value < VScroll1.Max Then
VScroll1.Value = VScroll1.Value + 1
Frame1.Top = Frame1.Top - 70
Else
Timer1.Interval = 0
End If
End Sub
If you want me for anything else just scream. DeltaFlyer The Only Programmer To Crash With Style. LOL
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.