home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / imagebox / testform.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-07-10  |  7.5 KB  |  238 lines

  1. VERSION 5.00
  2. Object = "*\AScrlImg.vbp"
  3. Begin VB.Form TestForm 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Scrolling ImageBox"
  6.    ClientHeight    =   4125
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   5385
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4125
  14.    ScaleWidth      =   5385
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   3  'Windows Default
  17.    Begin ScrollingImage.ScrollImgBox ScrollImgBox1 
  18.       Height          =   2535
  19.       Left            =   120
  20.       TabIndex        =   10
  21.       Top             =   720
  22.       Width           =   3615
  23.       _ExtentX        =   6376
  24.       _ExtentY        =   4471
  25.       PictureWidth    =   498
  26.       PictureHeight   =   226
  27.       Picture         =   "TestForm.frx":0000
  28.    End
  29.    Begin VB.CommandButton Command3 
  30.       Caption         =   "Show Position"
  31.       BeginProperty Font 
  32.          Name            =   "Tahoma"
  33.          Size            =   9.75
  34.          Charset         =   0
  35.          Weight          =   400
  36.          Underline       =   0   'False
  37.          Italic          =   0   'False
  38.          Strikethrough   =   0   'False
  39.       EndProperty
  40.       Height          =   375
  41.       Left            =   3900
  42.       TabIndex        =   7
  43.       Top             =   2745
  44.       Width           =   1395
  45.    End
  46.    Begin VB.CommandButton Command2 
  47.       Caption         =   "Move Down"
  48.       BeginProperty Font 
  49.          Name            =   "Tahoma"
  50.          Size            =   9.75
  51.          Charset         =   0
  52.          Weight          =   400
  53.          Underline       =   0   'False
  54.          Italic          =   0   'False
  55.          Strikethrough   =   0   'False
  56.       EndProperty
  57.       Height          =   375
  58.       Left            =   3900
  59.       TabIndex        =   1
  60.       Top             =   3660
  61.       Width           =   1395
  62.    End
  63.    Begin VB.CommandButton Command1 
  64.       Caption         =   "Move Right"
  65.       BeginProperty Font 
  66.          Name            =   "Tahoma"
  67.          Size            =   9.75
  68.          Charset         =   0
  69.          Weight          =   400
  70.          Underline       =   0   'False
  71.          Italic          =   0   'False
  72.          Strikethrough   =   0   'False
  73.       EndProperty
  74.       Height          =   375
  75.       Left            =   3900
  76.       TabIndex        =   0
  77.       Top             =   3195
  78.       Width           =   1395
  79.    End
  80.    Begin VB.Label Label7 
  81.       Caption         =   "Image Segment"
  82.       BeginProperty Font 
  83.          Name            =   "MS Sans Serif"
  84.          Size            =   9.75
  85.          Charset         =   0
  86.          Weight          =   400
  87.          Underline       =   0   'False
  88.          Italic          =   0   'False
  89.          Strikethrough   =   0   'False
  90.       EndProperty
  91.       Height          =   255
  92.       Left            =   150
  93.       TabIndex        =   9
  94.       Top             =   3360
  95.       Width           =   1650
  96.    End
  97.    Begin VB.Label Label6 
  98.       Caption         =   "Image Dimensions"
  99.       BeginProperty Font 
  100.          Name            =   "MS Sans Serif"
  101.          Size            =   9.75
  102.          Charset         =   0
  103.          Weight          =   400
  104.          Underline       =   0   'False
  105.          Italic          =   0   'False
  106.          Strikethrough   =   0   'False
  107.       EndProperty
  108.       Height          =   240
  109.       Left            =   195
  110.       TabIndex        =   8
  111.       Top             =   15
  112.       Width           =   2325
  113.    End
  114.    Begin VB.Label Label5 
  115.       BorderStyle     =   1  'Fixed Single
  116.       BeginProperty Font 
  117.          Name            =   "MS Sans Serif"
  118.          Size            =   9.75
  119.          Charset         =   0
  120.          Weight          =   400
  121.          Underline       =   0   'False
  122.          Italic          =   0   'False
  123.          Strikethrough   =   0   'False
  124.       EndProperty
  125.       Height          =   300
  126.       Left            =   1860
  127.       TabIndex        =   6
  128.       Top             =   3690
  129.       Width           =   1530
  130.    End
  131.    Begin VB.Label Label4 
  132.       BorderStyle     =   1  'Fixed Single
  133.       BeginProperty Font 
  134.          Name            =   "MS Sans Serif"
  135.          Size            =   9.75
  136.          Charset         =   0
  137.          Weight          =   400
  138.          Underline       =   0   'False
  139.          Italic          =   0   'False
  140.          Strikethrough   =   0   'False
  141.       EndProperty
  142.       Height          =   300
  143.       Left            =   165
  144.       TabIndex        =   5
  145.       Top             =   3690
  146.       Width           =   1530
  147.    End
  148.    Begin VB.Label Label3 
  149.       BeginProperty Font 
  150.          Name            =   "Tahoma"
  151.          Size            =   9.75
  152.          Charset         =   0
  153.          Weight          =   400
  154.          Underline       =   0   'False
  155.          Italic          =   0   'False
  156.          Strikethrough   =   0   'False
  157.       EndProperty
  158.       Height          =   240
  159.       Left            =   225
  160.       TabIndex        =   4
  161.       Top             =   3720
  162.       Width           =   1200
  163.    End
  164.    Begin VB.Label Label2 
  165.       BorderStyle     =   1  'Fixed Single
  166.       BeginProperty Font 
  167.          Name            =   "Tahoma"
  168.          Size            =   9
  169.          Charset         =   0
  170.          Weight          =   400
  171.          Underline       =   0   'False
  172.          Italic          =   0   'False
  173.          Strikethrough   =   0   'False
  174.       EndProperty
  175.       Height          =   300
  176.       Left            =   1890
  177.       TabIndex        =   3
  178.       Top             =   330
  179.       Width           =   1530
  180.    End
  181.    Begin VB.Label Label1 
  182.       BorderStyle     =   1  'Fixed Single
  183.       BeginProperty Font 
  184.          Name            =   "Tahoma"
  185.          Size            =   9
  186.          Charset         =   0
  187.          Weight          =   400
  188.          Underline       =   0   'False
  189.          Italic          =   0   'False
  190.          Strikethrough   =   0   'False
  191.       EndProperty
  192.       Height          =   300
  193.       Left            =   180
  194.       TabIndex        =   2
  195.       Top             =   330
  196.       Width           =   1530
  197.    End
  198. Attribute VB_Name = "TestForm"
  199. Attribute VB_GlobalNameSpace = False
  200. Attribute VB_Creatable = False
  201. Attribute VB_PredeclaredId = True
  202. Attribute VB_Exposed = False
  203. Option Explicit
  204. Dim X As Integer, Y As Integer
  205. Private Sub Command1_Click()
  206.     X = X + 5
  207.     ScrollImgBox1.ScrollTo (X), (Y)
  208. End Sub
  209. Private Sub Command2_Click()
  210.     Y = Y + 5
  211.     ScrollImgBox1.ScrollTo (X), (Y)
  212. End Sub
  213. Private Sub Command3_Click()
  214. Dim statusMsg As String
  215.     statusMsg = "The image's dimensions are: " & ScrollImgBox1.PictureWidth & " by " & ScrollImgBox1.PictureHeight & vbCrLf
  216.     statusMsg = statusMsg & "Its visible section starts at X = " & ScrollImgBox1.XPosition & ", Y = " & ScrollImgBox1.YPosition
  217.     MsgBox statusMsg
  218. End Sub
  219. Private Sub Form_Load()
  220.     Label1.Caption = "Width: " & ScrollImgBox1.PictureWidth
  221.     Label2.Caption = "Height: " & ScrollImgBox1.PictureHeight
  222. End Sub
  223. Private Sub ScrollImgbox1_ChangeX(X As Integer)
  224.     Label4.Caption = "X at: " & X
  225. End Sub
  226. Private Sub ScrollImgbox1_ChangeY(Y As Integer)
  227.     Label5.Caption = "Y at: " & Y
  228. End Sub
  229. Private Sub ScrollImgBox1_Click()
  230.     MsgBox "I was clicked"
  231. End Sub
  232. Private Sub ScrollImgbox1_ScrollX(X As Integer)
  233.     Label4.Caption = "X at: " & X
  234. End Sub
  235. Private Sub ScrollImgbox1_ScrollY(Y As Integer)
  236.     Label5.Caption = "Y at: " & Y
  237. End Sub
  238.