home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / vbpg32 / samples5 / ch09 / puzzle2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-02-16  |  3.4 KB  |  120 lines

  1. VERSION 5.00
  2. Begin VB.Form Puzzle2 
  3.    Caption         =   "Load Bitmap"
  4.    ClientHeight    =   2535
  5.    ClientLeft      =   1275
  6.    ClientTop       =   2085
  7.    ClientWidth     =   8085
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    ForeColor       =   &H80000008&
  18.    LinkMode        =   1  'Source
  19.    LinkTopic       =   "Form1"
  20.    PaletteMode     =   1  'UseZOrder
  21.    ScaleHeight     =   2535
  22.    ScaleWidth      =   8085
  23.    Begin VB.PictureBox picPreview 
  24.       Height          =   2295
  25.       Left            =   5400
  26.       ScaleHeight     =   2265
  27.       ScaleWidth      =   2565
  28.       TabIndex        =   5
  29.       Top             =   120
  30.       Width           =   2595
  31.    End
  32.    Begin VB.CommandButton CmdCancel 
  33.       Caption         =   "Cancel"
  34.       Height          =   375
  35.       Left            =   4140
  36.       TabIndex        =   4
  37.       Top             =   2040
  38.       Width           =   1095
  39.    End
  40.    Begin VB.CommandButton CmdLoad 
  41.       Caption         =   "Load"
  42.       Height          =   375
  43.       Left            =   2880
  44.       TabIndex        =   3
  45.       Top             =   2040
  46.       Width           =   1095
  47.    End
  48.    Begin VB.DirListBox Dir1 
  49.       Height          =   1815
  50.       Left            =   120
  51.       TabIndex        =   1
  52.       Top             =   600
  53.       Width           =   2535
  54.    End
  55.    Begin VB.FileListBox File1 
  56.       BackColor       =   &H00FFFFFF&
  57.       Height          =   1785
  58.       Left            =   2820
  59.       Pattern         =   "*.bmp"
  60.       TabIndex        =   2
  61.       Top             =   120
  62.       Width           =   2415
  63.    End
  64.    Begin VB.DriveListBox Drive1 
  65.       Height          =   315
  66.       Left            =   120
  67.       TabIndex        =   0
  68.       Top             =   120
  69.       Width           =   2535
  70.    End
  71. Attribute VB_Name = "Puzzle2"
  72. Attribute VB_GlobalNameSpace = False
  73. Attribute VB_Creatable = False
  74. Attribute VB_PredeclaredId = True
  75. Attribute VB_Exposed = False
  76. Option Explicit
  77. ' Copyright 
  78.  1997 by Desaware Inc. All Rights Reserved
  79. '   Hide the form and return control to the Puzzle form
  80. Private Sub CmdCancel_Click()
  81.     Puzzle2.Hide
  82. End Sub
  83. '   Load the selected file
  84. Private Sub CmdLoad_Click()
  85.     LoadBitmapFile
  86. End Sub
  87. Private Sub Dir1_Change()
  88.     File1.Path = Dir1.Path
  89. End Sub
  90. Private Sub Drive1_Change()
  91.     Dir1.Path = Drive1.Drive
  92. End Sub
  93. Private Sub File1_Click()
  94.     Dim fname$
  95.     Dim di&
  96.     If File1.filename <> "" Then
  97.         fname$ = File1.Path
  98.         If fname$ <> "\" Then fname$ = fname$ + "\"
  99.         fname$ = fname$ + File1.filename
  100.         picPreview.Picture = LoadPicture(fname$)
  101.     End If
  102. End Sub
  103. '   Load the selected file
  104. Private Sub File1_DblClick()
  105.     LoadBitmapFile
  106. End Sub
  107. '   Loads the bitmap file specified in the file box
  108. '   into bitmap 2 and reinitializes.
  109. Private Sub LoadBitmapFile()
  110.     Dim fname$
  111.     If File1.filename <> "" Then
  112.         fname$ = File1.Path
  113.         If fname$ <> "\" Then fname$ = fname$ + "\"
  114.         fname$ = fname$ + File1.filename
  115.         Puzzle.Picture2.Picture = LoadPicture(fname$)
  116.         DoTheUpdate% = -1
  117.     End If
  118.     Puzzle2.Hide    ' And exit this form
  119. End Sub
  120.