home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD988.psc / Viewer.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-24  |  3.9 KB  |  128 lines

  1. VERSION 5.00
  2. Begin VB.Form frmViewer 
  3.    BackColor       =   &H00000000&
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Viewer"
  6.    ClientHeight    =   6135
  7.    ClientLeft      =   1125
  8.    ClientTop       =   1455
  9.    ClientWidth     =   12945
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    PaletteMode     =   1  'UseZOrder
  14.    ScaleHeight     =   6135
  15.    ScaleWidth      =   12945
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.Frame Pis 
  18.       BackColor       =   &H00000000&
  19.       Caption         =   " Picture  "
  20.       ForeColor       =   &H0000FF00&
  21.       Height          =   5895
  22.       Left            =   2400
  23.       TabIndex        =   4
  24.       Top             =   120
  25.       Width           =   10455
  26.       Begin VB.Image FileImage 
  27.          Height          =   855
  28.          Left            =   120
  29.          Top             =   360
  30.          Width           =   1215
  31.       End
  32.    End
  33.    Begin VB.ComboBox PatternCombo 
  34.       Height          =   315
  35.       Left            =   120
  36.       TabIndex        =   3
  37.       Text            =   "Combo1"
  38.       Top             =   5760
  39.       Width           =   2175
  40.    End
  41.    Begin VB.DriveListBox DriveList 
  42.       Height          =   315
  43.       Left            =   120
  44.       TabIndex        =   2
  45.       Top             =   0
  46.       Width           =   2175
  47.    End
  48.    Begin VB.DirListBox DirList 
  49.       Height          =   2115
  50.       Left            =   120
  51.       TabIndex        =   1
  52.       Top             =   480
  53.       Width           =   2175
  54.    End
  55.    Begin VB.FileListBox FileList 
  56.       Height          =   3015
  57.       Left            =   120
  58.       TabIndex        =   0
  59.       Top             =   2640
  60.       Width           =   2175
  61.    End
  62. Attribute VB_Name = "frmViewer"
  63. Attribute VB_GlobalNameSpace = False
  64. Attribute VB_Creatable = False
  65. Attribute VB_PredeclaredId = True
  66. Attribute VB_Exposed = False
  67. Option Explicit
  68. Private Sub DirList_Change()
  69.     FileList.Path = DirList.Path
  70. End Sub
  71. Private Sub DriveList_Change()
  72.     'On Error GoTo DriveError
  73.     DirList.Path = DriveList.Drive
  74.     Exit Sub
  75. DriveError:
  76.     DriveList.Drive = DirList.Path
  77.     Exit Sub
  78. End Sub
  79. Private Sub FileList_Click()
  80. Dim fname As String
  81.     On Error GoTo LoadPictureError
  82.     fname = FileList.Path + "\" + FileList.FileName
  83.     Caption = "Viewer [" & fname & "]"
  84.     MousePointer = vbHourglass
  85.     DoEvents
  86.     FileImage.Picture = LoadPicture(fname)
  87.     MousePointer = vbDefault
  88.     Exit Sub
  89. LoadPictureError:
  90.     Beep
  91.     MousePointer = vbDefault
  92.     Caption = "Viewer [Invalid picture]"
  93.     Exit Sub
  94. End Sub
  95. Private Sub Form_Load()
  96.     PatternCombo.AddItem "Graphic (*.gif;*.jpg;*.ico;*.bmp;*.wmf;*.dib)"
  97.     PatternCombo.AddItem "Bitmaps (*.bmp)"
  98.     PatternCombo.AddItem "GIF (*.gif)"
  99.     PatternCombo.AddItem "JPEG (*.jpg)"
  100.     PatternCombo.AddItem "Icons (*.ico)"
  101.     PatternCombo.AddItem "Matafiles (*.wmf)"
  102.     PatternCombo.AddItem "DIBs (*.dib)"
  103.     PatternCombo.AddItem "All Files (*.*)"
  104.     PatternCombo.ListIndex = 0
  105. End Sub
  106. Private Sub Form_Resize()
  107. Const GAP = 60
  108. Dim wid As Integer
  109. Dim hgt As Integer
  110.     If WindowState = vbMinimized Then Exit Sub
  111.     wid = DriveList.Width
  112.     DriveList.Move GAP, GAP, wid
  113.     PatternCombo.Move GAP, ScaleHeight - PatternCombo.Height, wid
  114.     hgt = (PatternCombo.Top - DriveList.Top - DriveList.Height - 3 * GAP) / 2
  115.     If hgt < 100 Then hgt = 100
  116.     DirList.Move GAP, DriveList.Top + DriveList.Height + GAP, wid, hgt
  117.     FileList.Move GAP, DirList.Top + DirList.Height + GAP, wid, hgt
  118. End Sub
  119. Private Sub PatternCombo_Click()
  120. Dim pat As String
  121. Dim p1 As Integer
  122. Dim p2 As Integer
  123.     pat = PatternCombo.List(PatternCombo.ListIndex)
  124.     p1 = InStr(pat, "(")
  125.     p2 = InStr(pat, ")")
  126.     FileList.Pattern = Mid$(pat, p1 + 1, p2 - p1 - 1)
  127. End Sub
  128.