*/
Written some cool source code? Upload it to Programmer's Heaven.
*/

View Picture Viewer\frmPicture.frm

Picture Viewer Ver 1.0

Submitted By: PSProgramHome
Rating: (Not rated) (Rate It)


VERSION 5.00
Begin VB.Form frmPicture
   BackColor       =   &H00FF8080&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Picture Viewer"
   ClientHeight    =   5985
   ClientLeft      =   1125
   ClientTop       =   1530
   ClientWidth     =   7290
   Icon            =   "frmPicture.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   5985
   ScaleWidth      =   7290
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdExit
      BackColor       =   &H0000FFFF&
      Caption         =   "E&xit"
      Height          =   495
      Left            =   4680
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   5400
      Width           =   2415
   End
   Begin VB.CommandButton cmdShowPic
      BackColor       =   &H00FF00FF&
      Caption         =   "&Display picture"
      Height          =   495
      Left            =   2040
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   5400
      Width           =   2415
   End
   Begin VB.DriveListBox drvImage
      BackColor       =   &H8000000E&
      Height          =   315
      Left            =   120
      TabIndex        =   5
      Top             =   3000
      Width           =   1695
   End
   Begin VB.FileListBox filImage1
      BackColor       =   &H8000000E&
      Height          =   1455
      Left            =   120
      Pattern         =   "*.bmp;*.ico;*.wmf;*.gif;*.jpg"
      TabIndex        =   1
      Top             =   720
      Width           =   1695
   End
   Begin VB.DirListBox dirImage
      BackColor       =   &H8000000E&
      Height          =   1890
      Left            =   120
      TabIndex        =   0
      Top             =   3960
      Width           =   1695
   End
   Begin VB.Label lblImage
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   2040
      TabIndex        =   8
      Top             =   4680
      Width           =   5055
   End
   Begin VB.Image imgImage1
      BorderStyle     =   1  'Fixed Single
      Height          =   4215
      Left            =   2040
      Stretch         =   -1  'True
      Top             =   240
      Width           =   5055
   End
   Begin VB.Label Label3
      BackColor       =   &H00FF8080&
      Caption         =   "Drives"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   4
      Top             =   2400
      Width           =   975
   End
   Begin VB.Label Label2
      BackColor       =   &H00FF8080&
      Caption         =   "Directories"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   3
      Top             =   3480
      Width           =   1575
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Files"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   120
      TabIndex        =   2
      Top             =   240
      Width           =   855
   End
End
Attribute VB_Name = "frmPicture"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdExit_Click()
    End
End Sub

Private Sub cmdShowPic_Click()
     Dim ImageView As String    ' a string variable
   
    'Check to see if filename blank
    If filImage1.FileName = "" Then Exit Sub
   
    'Check to see if at root directory
     If Right(filImage1.Path, 1) = "\" Then
     ImageView = filImage1.Path + filImage1.FileName
     Else
        ImageView = filImage1.Path + "\" + filImage1.FileName
     End If
    lblImage.Caption = ImageView
    imgImage1.Picture = LoadPicture(ImageView)
End Sub

Private Sub dirImage_Change()
'If directory changes, update file path
filImage1.Path = dirImage.Path
End Sub

Private Sub drvImage_Change()
'If drive changes, update directory
dirImage.Path = drvImage.Drive
End Sub


Private Sub filImage_DblClick()
    'displays the picture
    Call cmdShowPic_Click
End Sub

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.