'Picked this up somewhere, never tried it, maybe it'll work
'If not, maybe it'll give you a track to start on. Let us
'know if it does, or code that works if you get it going
' 1 create a new standard app
' 2 add a frame on your app
' 2a borderstyle = none
' 3 put a textbox or whatever on your FR
' AME!!
' 4 put a picturebox on your FRAME !!
' 4a borderstyle = none
' 5 add this code and voila your done!!!
'
Option Explicit
Dim this As Integer
Private Sub Form_Load()
this = 1
' set the frame totally down so you can'
' t see it
Frame1.Top = Me.Height
End Sub
Private Sub Timer1_Timer()
' the rate of scrolling down
frame1.Top = (Frame1.Top - 20)
' if the the bottom of the frame reaches
' the top of your
'app it goes down
If Frame1.Top <= 0 - Frame1.Height Then
'next picture on the frame
this = this + 1
'call the function "here"
Call here
Frame1.Top = Me.Height
End If
End Sub
Private Sub here()
Select Case this
' this code changes every time the frame
' passed the screen the picture on the fra
' me
'( you can change this in whatever you w
' ant)
Case Is = 1
Picture1 = LoadPicture("c:\ohio.jpg"
Case Is = 2
Picture1 = LoadPicture("c:\ohio1.jpg"
Case Is = 3
Picture1 = LoadPicture("c:\me2.jpg"
Case Is = 4
this = 1
End Select
End Sub
have two picture boxes, one inside the other and a vertical scroll bar.
You need
Private Sub VScroll1_Scroll()
picInner.Top = -VScroll1.Value
End Sub
Private Sub VScroll1_Change()
Call VScroll1_Scroll
End Sub
make picouter a sensible size on your form and give picinner a huge height. As they insist on saying, voila
'Add 2 Picture Boxes To Your Form. Add picture to Picture1 Picture Box
'Add 1 Command Button to your form.
'The following sample will stretch the first Picture Box to the size of the second Picture Box.
'Insert the following code to your form:
Private Sub Command1_Click()
Picture1.AutoSize = True
Picture2.AutoRedraw = True
Picture2.PaintPicture Picture1.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, _
0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
End Sub
set a HscrollBar (named hbar) and a VscrollBar (named vbar)
a module with :
Private Sub ArrangeScrollbars()
Dim need_hgt As Single
Dim need_wid As Single
Dim got_hgt As Single
Dim got_wid As Single
Dim need_hbar As Boolean
Dim need_vbar As Boolean
' hebben we de horizontale nodig
need_hbar = (got_wid < need_wid)
If need_hbar Then
got_hgt = got_hgt - hbar.Height
End If
' hebben we de verticale nodig
need_vbar = (got_hgt < need_hgt)
If need_vbar Then
got_wid = got_wid - vbar.Width
If Not need_hbar Then
need_hbar = (got_wid < need_wid)
If need_hbar Then
got_hgt = got_hgt - hbar.Height
End If
End If
End If
If got_hgt < 120 Then got_hgt = 120
If got_wid < 120 Then got_wid = 120
' toon de nodige scrollbar
If need_hbar Then
hbar.min = 0
hbar.max = got_wid - need_wid
hbar.SmallChange = got_wid / 3
hbar.LargeChange = _
(hbar.max - hbar.min) _
* need_wid / _
(got_wid - need_wid)
hbar.Visible = True
Else
hbar.Visible = False
End If
If need_vbar Then
vbar.min = 0
vbar.max = got_hgt - need_hgt
vbar.SmallChange = got_hgt / 3
vbar.LargeChange = _
(vbar.max - vbar.min) _
* need_hgt / _
(got_hgt - need_hgt)
vbar.Visible = True
Else
vbar.Visible = False
End If
End Sub
a pictureBox and a commondialog
Private Sub LoadFromFile_Click()
On Error Resume Next
With CommonDialog1
.CancelError = True
.Filter = "Pictures(*.bmp;*.ico;*.gif;*.jpg;*.wmf)|*.bmp;*.ico;*.gif;*.jpg;*.wmf|"
.Flags = cdlOFNHideReadOnly
.ShowOpen
If Err.Number = cdlCancel Then
Err.Clear
Exit Sub
End If
CurFoto = .FilterIndex - 1
FileName = .FileName
FileName.Visible = True
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.