Article ID: 109741
Article Last Modified on 7/13/2004
Sub Form_Load()
' Make the picture box bigger than the form:
Picture1.Move 0, 0, 1.4 * ScaleWidth, 1.2 * ScaleHeight
' Position and size the first TextBox:
Text1(0).Move 0, 0, Picture1.Width / 2, Picture1.Height / 20
' Place some sample controls in the picture box:
Dim i As Integer
For i = 1 To 20
Load Text1(i)
Text1(i).Visible = True
Text1(i).Left = i * Picture1.Height / 20
Text1(i).Top = Text1(i).Left
Next
End Sub
Sub Form_Resize ()
' Position the scroll bars:
hscroll1.Left = 0
vscroll1.Top = 0
If Picture1.Width > scalewidth Then
hscroll1.Top = ScaleHeight - hscroll1.Height
Else
hscroll1.Top = ScaleHeight
End If
If Picture1.Height > hscroll1.Top Then
vscroll1.Left = scalewidth - vscroll1.Width
If Picture1.Width > vscroll1.Left Then
hscroll1.Top = ScaleHeight - hscroll1.Height
End If
Else
vscroll1.Left = scalewidth
End If
hscroll1.Width = scalewidth
If hscroll1.Top > 0 then vscroll1.Height=hscroll1.Top
' Set the scroll bar ranges
hscroll1.Max = Picture1.Width - vscroll1.Left
vscroll1.Max = Picture1.Height - hscroll1.Top
hscroll1.SmallChange = Abs(hscroll1.Max \ 16) + 1
hscroll1.LargeChange = Abs(hscroll1.Max \ 4) + 1
vscroll1.SmallChange = Abs(vscroll1.Max \ 16) + 1
vscroll1.LargeChange = Abs(vscroll1.Max \ 4) + 1
hscroll1.ZOrder 0
vscroll1.ZOrder 0
End Sub
Sub HScroll1_Change ()
Picture1.Left = -HScroll1.Value
End Sub
Sub VScroll1_Change ()
Picture1.Top = -VScroll1.Value
End SubAdditional query words: 3.00 4.00 vb416
Keywords: kbhowto KB109741