home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / simple6a / form2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-22  |  3.3 KB  |  111 lines

  1. VERSION 5.00
  2. Begin VB.Form Form2 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Carregar Imagem"
  5.    ClientHeight    =   4290
  6.    ClientLeft      =   45
  7.    ClientTop       =   345
  8.    ClientWidth     =   6105
  9.    Icon            =   "Form2.frx":0000
  10.    LinkTopic       =   "Form2"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4290
  14.    ScaleWidth      =   6105
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   3  'Windows Default
  17.    Begin VB.CommandButton Command2 
  18.       Caption         =   "&OK"
  19.       Height          =   495
  20.       Left            =   2040
  21.       TabIndex        =   4
  22.       Top             =   3720
  23.       Width           =   1935
  24.    End
  25.    Begin VB.DriveListBox Drive1 
  26.       Height          =   315
  27.       Left            =   120
  28.       TabIndex        =   3
  29.       Top             =   3240
  30.       Width           =   2895
  31.    End
  32.    Begin VB.DirListBox Dir1 
  33.       Height          =   3015
  34.       Left            =   120
  35.       TabIndex        =   2
  36.       Top             =   120
  37.       Width           =   2895
  38.    End
  39.    Begin VB.FileListBox File1 
  40.       Height          =   3405
  41.       Hidden          =   -1  'True
  42.       Left            =   3120
  43.       Pattern         =   "*.bmp;*.gif;*.jpg;*.wmf"
  44.       System          =   -1  'True
  45.       TabIndex        =   1
  46.       Top             =   120
  47.       Width           =   2895
  48.    End
  49.    Begin VB.CommandButton Command1 
  50.       Caption         =   "&Cancelar"
  51.       Height          =   495
  52.       Left            =   4080
  53.       TabIndex        =   0
  54.       Top             =   3720
  55.       Width           =   1935
  56.    End
  57.    Begin VB.Image Image1 
  58.       Height          =   9000
  59.       Left            =   5040
  60.       Picture         =   "Form2.frx":0442
  61.       Top             =   0
  62.       Visible         =   0   'False
  63.       Width           =   12000
  64.    End
  65. Attribute VB_Name = "Form2"
  66. Attribute VB_GlobalNameSpace = False
  67. Attribute VB_Creatable = False
  68. Attribute VB_PredeclaredId = True
  69. Attribute VB_Exposed = False
  70. Option Compare Text
  71. Private Sub Command1_Click()
  72. 'Cancel was pressed. Unload the Image Loader Form
  73.     Unload Me
  74. End Sub
  75. Private Sub Command2_Click()
  76. 'Ok was pressed. Set the puzzle new image
  77.     Dim S As String
  78. 'Get the file's path and check if it already has a "\"
  79. 'If not then add one "\"
  80.     S = File1.Path
  81.     If Not S Like "*\" Then S = S & "\"
  82. 'Now add the file name
  83.     S = S & File1.FileName
  84. 'Unload the Image Loader Form
  85.     Unload Me
  86. 'Load the puzzle new image
  87.     Image1.Picture = LoadPicture(S)
  88. 'Hide the pieces and start again
  89.     HideAll
  90.     Start
  91. End Sub
  92. Private Sub Dir1_Change()
  93. 'Set the FileListBox Path equal to the DirListBox
  94.     File1.Path = Dir1.Path
  95. End Sub
  96. Private Sub Drive1_Change()
  97.     On Error Resume Next
  98. 'Set the DirListBox Path equal to the DriveListBox
  99. 'selected drive
  100.     Dir1.Path = UCase(Drive1.Drive)
  101. 'Error 68 ocurrs when there is an error with access to
  102. 'the Drive
  103.     If Err.Number = 68 Then
  104.         Err.Clear
  105. 'Check if the user want's to retry
  106.         If MsgBox("The drive " & Drive1.Drive & " is not ready! Try again?", vbApplicationModal + vbExclamation + vbYesNo, "Error") = vbYes Then GoTo RR
  107. 'Else set the Drive to the default C: drive
  108.         Drive1.Drive = "C:\"
  109.     End If
  110. End Sub
  111.