home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch06 / scrollpic / scrolpic.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-03-03  |  3.0 KB  |  89 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "PictureScroll"
  4.    ClientHeight    =   5595
  5.    ClientLeft      =   165
  6.    ClientTop       =   450
  7.    ClientWidth     =   8880
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   5595
  10.    ScaleWidth      =   8880
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.VScrollBar VScroll1 
  13.       Height          =   2205
  14.       Left            =   10260
  15.       TabIndex        =   3
  16.       Top             =   1260
  17.       Width           =   240
  18.    End
  19.    Begin VB.HScrollBar HScroll1 
  20.       Height          =   225
  21.       Left            =   7065
  22.       TabIndex        =   2
  23.       Top             =   3480
  24.       Width           =   3210
  25.    End
  26.    Begin VB.PictureBox Picture2 
  27.       AutoRedraw      =   -1  'True
  28.       Height          =   2235
  29.       Left            =   7065
  30.       ScaleHeight     =   2175
  31.       ScaleWidth      =   3150
  32.       TabIndex        =   1
  33.       Top             =   1245
  34.       Width           =   3210
  35.    End
  36.    Begin VB.PictureBox Picture1 
  37.       AutoSize        =   -1  'True
  38.       Height          =   5160
  39.       Left            =   195
  40.       Picture         =   "scrolpic.frx":0000
  41.       ScaleHeight     =   340
  42.       ScaleMode       =   3  'Pixel
  43.       ScaleWidth      =   406
  44.       TabIndex        =   0
  45.       Top             =   135
  46.       Width           =   6150
  47.    End
  48. Attribute VB_Name = "Form1"
  49. Attribute VB_GlobalNameSpace = False
  50. Attribute VB_Creatable = False
  51. Attribute VB_PredeclaredId = True
  52. Attribute VB_Exposed = False
  53. Option Explicit
  54. Private Sub Form_Load()
  55.     HScroll1.Min = 0
  56.     HScroll1.Max = ScaleX(Picture1.Picture.Width, 8, vbTwips) - Picture2.Width
  57.     HScroll1.LargeChange = 10 * Screen.TwipsPerPixelX
  58.     HScroll1.SmallChange = Screen.TwipsPerPixelX
  59.     VScroll1.Min = 0
  60.     VScroll1.Max = ScaleX(Picture1.Picture.Height, 8, vbTwips) - Picture2.Height
  61.     VScroll1.LargeChange = 10 * Screen.TwipsPerPixelY
  62.     VScroll1.SmallChange = Screen.TwipsPerPixelY
  63.     HScroll1_Change     ' this line forces a redraw of the small PictureBox
  64. End Sub
  65. Private Sub HScroll1_Change()
  66.     Picture2.PaintPicture Picture1.Picture, 0, 0, _
  67.         Picture2.Width, Picture2.Height, _
  68.         HScroll1.Value, VScroll1.Value, _
  69.         Picture2.Width, Picture2.Height
  70. End Sub
  71. Private Sub HScroll1_Scroll()
  72.     Picture2.PaintPicture Picture1.Picture, 0, 0, _
  73.         Picture2.Width, Picture2.Height, _
  74.         HScroll1.Value, VScroll1.Value, _
  75.         Picture2.Width, Picture2.Height
  76. End Sub
  77. Private Sub VScroll1_Change()
  78.     Picture2.PaintPicture Picture1.Picture, 0, 0, _
  79.         Picture2.Width, Picture2.Height, _
  80.         HScroll1.Value, VScroll1.Value, _
  81.         Picture2.Width, Picture2.Height
  82. End Sub
  83. Private Sub VScroll1_Scroll()
  84.     Picture2.PaintPicture Picture1.Picture, 0, 0, _
  85.         Picture2.Width, Picture2.Height, _
  86.         HScroll1.Value, VScroll1.Value, _
  87.         Picture2.Width, Picture2.Height
  88. End Sub
  89.