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 / frmTake.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-01-04  |  5.0 KB  |  177 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmTake 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Tutorial v1.0.0 (Take)"
  6.    ClientHeight    =   4815
  7.    ClientLeft      =   150
  8.    ClientTop       =   435
  9.    ClientWidth     =   6885
  10.    Icon            =   "frmTake.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4815
  15.    ScaleWidth      =   6885
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin MSComDlg.CommonDialog cmm 
  18.       Left            =   3240
  19.       Top             =   2160
  20.       _ExtentX        =   847
  21.       _ExtentY        =   847
  22.       _Version        =   393216
  23.    End
  24.    Begin VB.PictureBox Picture1 
  25.       BorderStyle     =   0  'None
  26.       Enabled         =   0   'False
  27.       Height          =   4215
  28.       Left            =   120
  29.       ScaleHeight     =   4215
  30.       ScaleWidth      =   4095
  31.       TabIndex        =   6
  32.       Top             =   480
  33.       Width           =   4095
  34.       Begin VB.TextBox txtText 
  35.          Height          =   4215
  36.          Left            =   0
  37.          MultiLine       =   -1  'True
  38.          ScrollBars      =   2  'Vertical
  39.          TabIndex        =   7
  40.          Top             =   0
  41.          Width           =   4095
  42.       End
  43.    End
  44.    Begin VB.Frame Frame1 
  45.       Caption         =   "Controls"
  46.       Height          =   2055
  47.       Left            =   4320
  48.       TabIndex        =   0
  49.       Top             =   2640
  50.       Width           =   2535
  51.       Begin VB.CommandButton cmdEnlarge 
  52.          Caption         =   "Enlarge Pic"
  53.          Height          =   495
  54.          Left            =   240
  55.          TabIndex        =   3
  56.          Top             =   1440
  57.          Width           =   2175
  58.       End
  59.       Begin VB.CommandButton cmdBack 
  60.          Caption         =   "<< Back"
  61.          Height          =   495
  62.          Left            =   240
  63.          TabIndex        =   2
  64.          Top             =   840
  65.          Width           =   2175
  66.       End
  67.       Begin VB.CommandButton cmdNext 
  68.          Caption         =   "Next >>"
  69.          Height          =   495
  70.          Left            =   240
  71.          TabIndex        =   1
  72.          Top             =   240
  73.          Width           =   2175
  74.       End
  75.    End
  76.    Begin VB.Label Label2 
  77.       Caption         =   "Text:"
  78.       Height          =   255
  79.       Left            =   120
  80.       TabIndex        =   5
  81.       Top             =   120
  82.       Width           =   3975
  83.    End
  84.    Begin VB.Label Label1 
  85.       Caption         =   "Pic:"
  86.       Height          =   255
  87.       Left            =   4320
  88.       TabIndex        =   4
  89.       Top             =   120
  90.       Width           =   2535
  91.    End
  92.    Begin VB.Image imgPic 
  93.       Height          =   2055
  94.       Left            =   4320
  95.       Stretch         =   -1  'True
  96.       Top             =   480
  97.       Width           =   2535
  98.    End
  99.    Begin VB.Menu FI 
  100.       Caption         =   "File"
  101.       Begin VB.Menu OP 
  102.          Caption         =   "Open"
  103.       End
  104.       Begin VB.Menu sep1 
  105.          Caption         =   "-"
  106.       End
  107.       Begin VB.Menu MA 
  108.          Caption         =   "Make"
  109.       End
  110.       Begin VB.Menu sep2 
  111.          Caption         =   "-"
  112.       End
  113.       Begin VB.Menu EX 
  114.          Caption         =   "Exit"
  115.       End
  116.    End
  117. Attribute VB_Name = "frmTake"
  118. Attribute VB_GlobalNameSpace = False
  119. Attribute VB_Creatable = False
  120. Attribute VB_PredeclaredId = True
  121. Attribute VB_Exposed = False
  122. Dim on_page As Long
  123. Dim pic(99) As String, text(99) As String, xx() As String, pic2() As String, text2() As String
  124. Private Sub cmdBack_Click()
  125. If on_page = 1 Then
  126.     Me.Caption = "Tutorial v1.0.0 (Take) - Error lowest number page alowed is 1!"
  127.     Exit Sub
  128. End If
  129. on_page = on_page - 1
  130. imgPic.Picture = LoadPicture(pic(on_page - 1))
  131. txtText.text = text(on_page - 1)
  132. End Sub
  133. Private Sub cmdEnlarge_Click()
  134. frmEnl.go imgPic.Picture
  135. End Sub
  136. Private Sub cmdNext_Click()
  137. If on_page = 100 Then
  138.     Me.Caption = "Tutorial v1.0.0 (Take) - Error only 100 pages alowed!"
  139.     Exit Sub
  140. End If
  141. on_page = on_page + 1
  142. imgPic.Picture = LoadPicture(pic(on_page - 1))
  143. txtText.text = text(on_page - 1)
  144. End Sub
  145. Private Sub Form_Load()
  146. on_page = 1
  147. End Sub
  148. Private Sub Form_Unload(Cancel As Integer)
  149. Unload frmMake
  150. Unload Me
  151. End Sub
  152. Private Sub MA_Click()
  153. Me.Hide
  154. frmMake.Show
  155. End Sub
  156. Private Sub OP_Click()
  157. cmm.Filter = "Tutorial Files (*.tut)|*.tut"
  158. cmm.ShowOpen
  159. Open cmm.FileName For Input As #1
  160.     Line Input #1, a
  161.     xx = Split(a, "~")
  162.     pic2 = Split(xx(0), "
  163.     text2 = Split(xx(1), "
  164. Close #1
  165. For x = 0 To 99
  166.     pic(x) = pic2(x)
  167.     If Not FileExist(pic(x)) Then
  168.         pic(x) = App.Path & "\" & GetFileNameFromPath(pic(x))
  169.     End If
  170.     text(x) = text2(x)
  171. Next x
  172. on_page = 1
  173. cmdNext_Click
  174. cmdBack_Click
  175. Me.Caption = "Tutorial v1.0.0 (Take)"
  176. End Sub
  177.