home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Tutorial_M46439152002.psc / runner / frmTake.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-01-04  |  4.2 KB  |  143 lines

  1. VERSION 5.00
  2. Begin VB.Form frmTake 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Tutorial v1.0.0 (Take)"
  5.    ClientHeight    =   4815
  6.    ClientLeft      =   150
  7.    ClientTop       =   150
  8.    ClientWidth     =   6885
  9.    Icon            =   "frmTake.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4815
  14.    ScaleWidth      =   6885
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.PictureBox Picture1 
  17.       BorderStyle     =   0  'None
  18.       Enabled         =   0   'False
  19.       Height          =   4215
  20.       Left            =   120
  21.       ScaleHeight     =   4215
  22.       ScaleWidth      =   4095
  23.       TabIndex        =   6
  24.       Top             =   480
  25.       Width           =   4095
  26.       Begin VB.TextBox txtText 
  27.          Height          =   4215
  28.          Left            =   0
  29.          MultiLine       =   -1  'True
  30.          ScrollBars      =   2  'Vertical
  31.          TabIndex        =   7
  32.          Top             =   0
  33.          Width           =   4095
  34.       End
  35.    End
  36.    Begin VB.Frame Frame1 
  37.       Caption         =   "Controls"
  38.       Height          =   2055
  39.       Left            =   4320
  40.       TabIndex        =   0
  41.       Top             =   2640
  42.       Width           =   2535
  43.       Begin VB.CommandButton cmdEnlarge 
  44.          Caption         =   "Enlarge Pic"
  45.          Height          =   495
  46.          Left            =   240
  47.          TabIndex        =   3
  48.          Top             =   1440
  49.          Width           =   2175
  50.       End
  51.       Begin VB.CommandButton cmdBack 
  52.          Caption         =   "<< Back"
  53.          Height          =   495
  54.          Left            =   240
  55.          TabIndex        =   2
  56.          Top             =   840
  57.          Width           =   2175
  58.       End
  59.       Begin VB.CommandButton cmdNext 
  60.          Caption         =   "Next >>"
  61.          Height          =   495
  62.          Left            =   240
  63.          TabIndex        =   1
  64.          Top             =   240
  65.          Width           =   2175
  66.       End
  67.    End
  68.    Begin VB.Label Label2 
  69.       Caption         =   "Text:"
  70.       Height          =   255
  71.       Left            =   120
  72.       TabIndex        =   5
  73.       Top             =   120
  74.       Width           =   3975
  75.    End
  76.    Begin VB.Label Label1 
  77.       Caption         =   "Pic:"
  78.       Height          =   255
  79.       Left            =   4320
  80.       TabIndex        =   4
  81.       Top             =   120
  82.       Width           =   2535
  83.    End
  84.    Begin VB.Image imgPic 
  85.       Height          =   2055
  86.       Left            =   4320
  87.       Stretch         =   -1  'True
  88.       Top             =   480
  89.       Width           =   2535
  90.    End
  91. Attribute VB_Name = "frmTake"
  92. Attribute VB_GlobalNameSpace = False
  93. Attribute VB_Creatable = False
  94. Attribute VB_PredeclaredId = True
  95. Attribute VB_Exposed = False
  96. Dim on_page As Long
  97. Dim pic(99) As String, text(99) As String, xx() As String, pic2() As String, text2() As String
  98. Private Sub cmdBack_Click()
  99. If on_page = 1 Then
  100.     Me.Caption = "Tutorial v1.0.0 (Take) - Error lowest number page alowed is 1!"
  101.     Exit Sub
  102. End If
  103. on_page = on_page - 1
  104. imgPic.Picture = LoadPicture(pic(on_page - 1))
  105. txtText.text = text(on_page - 1)
  106. End Sub
  107. Private Sub cmdEnlarge_Click()
  108. frmEnl.go imgPic.Picture
  109. End Sub
  110. Private Sub cmdNext_Click()
  111. If on_page = 100 Then
  112.     Me.Caption = "Tutorial v1.0.0 (Take) - Error only 100 pages alowed!"
  113.     Exit Sub
  114. End If
  115. on_page = on_page + 1
  116. imgPic.Picture = LoadPicture(pic(on_page - 1))
  117. txtText.text = text(on_page - 1)
  118. End Sub
  119. Private Sub Form_Load()
  120. on_page = 1
  121. GetFile App.Path & "\" & App.EXEName & ".exe", 32768, App.Path & "\tmp.tut"
  122. Open App.Path & "\tmp.tut" For Input As #1
  123.     Line Input #1, a
  124.     xx = Split(a, "~")
  125.     pic2 = Split(xx(0), "
  126.     text2 = Split(xx(1), "
  127. Close #1
  128. For x = 0 To 99
  129.     pic(x) = pic2(x)
  130.     If Not FileExist(pic(x)) Then
  131.         pic(x) = App.Path & "\" & GetFileNameFromPath(pic(x))
  132.     End If
  133.     text(x) = text2(x)
  134. Next x
  135. on_page = 1
  136. cmdNext_Click
  137. cmdBack_Click
  138. Me.Caption = "Tutorial v1.0.0 (Take)"
  139. End Sub
  140. Private Sub Form_Unload(Cancel As Integer)
  141. Unload Me
  142. End Sub
  143.