VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "VB6 例10-16 图形滚动"
   ClientHeight    =   3255
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5010
   LinkTopic       =   "Form1"
   ScaleHeight     =   3255
   ScaleWidth      =   5010
   StartUpPosition =   3  '窗口缺省
   Begin VB.HScrollBar HScroll1 
      Height          =   255
      LargeChange     =   50
      Left            =   780
      SmallChange     =   10
      TabIndex        =   2
      Top             =   1440
      Width           =   1335
   End
   Begin VB.VScrollBar VScroll1 
      Height          =   1395
      LargeChange     =   50
      Left            =   2220
      SmallChange     =   10
      TabIndex        =   1
      Top             =   420
      Width           =   255
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      DrawMode        =   1  'Blackness
      ForeColor       =   &H80000008&
      Height          =   6045
      Left            =   0
      Picture         =   "V6bj10-16.frx":0000
      ScaleHeight     =   6015
      ScaleWidth      =   6600
      TabIndex        =   0
      Top             =   0
      Width           =   6630
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub HVScroll()
    ' 定义水平滚动条HScroll1的位置和宽度、最大、最小属性及可见性
    HScroll1.Left = 0: HScroll1.Top = Form1.ScaleHeight - HScroll1.Height
    HScroll1.Width = Form1.ScaleWidth - VScroll1.Width
    HScroll1.Max = Picture1.Width - Form1.ScaleWidth   ' 滚动条卷动值
    HScroll1.Visible = (Picture1.Width > Form1.ScaleWidth)
    ' 定义垂直滚动条    VScroll1的位置和高度、最大、最小属性及可见性
    VScroll1.Top = 0: VScroll1.Left = Form1.ScaleWidth - VScroll1.Width
    VScroll1.Height = Form1.ScaleHeight - HScroll1.Height
    VScroll1.Max = (Picture1.Height - Form1.ScaleHeight)
    VScroll1.Visible = (Picture1.Height > Form1.ScaleHeight)
End Sub
Private Sub Form_Load()
    Picture1.Move 0, 0                        ' 移图形框到坐标原点
    HVScroll
    HScroll1.ZOrder 0                         ' 放在图形框前
    VScroll1.ZOrder 0
End Sub
Private Sub Form_Resize()
    HVScroll
End Sub
Private Sub HScroll1_Change()
    Picture1.Left = -HScroll1.Value
End Sub
Private Sub HScroll1_Scroll()
'    Picture1.Left = -HScroll1.Value
End Sub
Private Sub VScroll1_Change()
    Picture1.Top = -VScroll1.Value
End Sub
Private Sub VScroll1_Scroll()
 '   Picture1.Top = -VScroll1.Value
End Sub

