home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmOpen
- BorderStyle = 3 'Fixed Dialog
- Caption = "Choose a file to view"
- ClientHeight = 3300
- ClientLeft = 1545
- ClientTop = 2880
- ClientWidth = 6900
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 3300
- ScaleWidth = 6900
- ShowInTaskbar = 0 'False
- Begin VB.TextBox txtPattern
- Height = 315
- Left = 60
- TabIndex = 10
- Text = "*.*"
- Top = 2820
- Visible = 0 'False
- Width = 2475
- End
- Begin VB.CommandButton cmdExit
- Caption = "E&xit"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 5460
- TabIndex = 6
- Top = 600
- Width = 1275
- End
- Begin VB.CommandButton cmdView
- Caption = "&View"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 5460
- TabIndex = 5
- Top = 180
- Width = 1275
- End
- Begin VB.TextBox txtFileName
- Height = 285
- Left = 120
- TabIndex = 3
- Top = 240
- Visible = 0 'False
- Width = 2415
- End
- Begin VB.DriveListBox Drive1
- Height = 315
- Left = 2820
- TabIndex = 2
- Top = 2820
- Width = 2475
- End
- Begin VB.FileListBox File1
- BackColor = &H00FFFFFF&
- ForeColor = &H00000000&
- Height = 1785
- Left = 120
- TabIndex = 1
- Top = 600
- Width = 2415
- End
- Begin VB.DirListBox Dir1
- Height = 1830
- Left = 2820
- TabIndex = 0
- Top = 540
- Width = 2475
- End
- Begin VB.Label Label3
- Caption = "View Files of Type:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 60
- TabIndex = 11
- Top = 2580
- Visible = 0 'False
- Width = 1635
- End
- Begin VB.Label lblPath
- Caption = "E:\vb4\icons\misc"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 195
- Left = 2820
- TabIndex = 9
- Top = 300
- Width = 2475
- End
- Begin VB.Label Label2
- Caption = "Directories:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 195
- Left = 2820
- TabIndex = 8
- Top = 60
- Width = 1455
- End
- Begin VB.Label Label1
- Caption = "Drives:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 2820
- TabIndex = 7
- Top = 2580
- Width = 1635
- End
- Begin VB.Label Label4
- Caption = "File Name:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 195
- Left = 120
- TabIndex = 4
- Top = 60
- Visible = 0 'False
- Width = 1395
- End
- Attribute VB_Name = "frmOpen"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' Copyright
- 1997 by Desaware Inc. All Rights Reserved
- Dim oldDrive$
- Private Sub cmdExit_Click()
- Unload Me
- End Sub
- Private Sub cmdView_Click()
- Dim s$
- s$ = Dir1.Path
- If Right$(s$, 1) <> "\" Then
- s$ = s$ & "\"
- End If
- s$ = s$ & File1.List(File1.ListIndex)
- Load frmView
- frmView.Initialize s$
- frmView.Show 1
- End Sub
- Private Sub Dir1_Change()
- File1.Path = Dir1.Path
- lblPath = Dir1.Path
- End Sub
- Private Sub Drive1_Change()
- On Error GoTo handler
- Dir1.Path = Drive1.Drive
- oldDrive$ = Drive1.Drive
- Exit Sub
- handler:
- Select Case Err
- Case 68:
- MsgBox "Drive " & UCase$(Drive1.Drive) & " is not available."
- Drive1.Drive = oldDrive$
- End Select
- Exit Sub
- End Sub
- Private Sub File1_DblClick()
- cmdView_Click
- End Sub
- Private Sub Form_Load()
- oldDrive$ = Drive1.Drive
- End Sub
- Private Sub txtPattern_KeyPress(KeyAscii As Integer)
- If KeyAscii = 13 Then
- If txtPattern = "" Then
- txtPattern = "*.*"
- Else
- If Right$(txtPattern, 1) = "." Then
- txtPattern = txtPattern & "*"
- ElseIf InStr(txtPattern, ".") = 0 Then
- txtPattern = txtPattern & "*.*"
- End If
- End If
- File1.Pattern = txtPattern.Text
- KeyAscii = 0
- End If
- End Sub
-