home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / iconalb / searchfo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-14  |  4.3 KB  |  146 lines

  1. VERSION 4.00
  2. Begin VB.Form SearchForm 
  3.    Caption         =   "Search Icons"
  4.    ClientHeight    =   3930
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1515
  7.    ClientWidth     =   6540
  8.    Icon            =   "SearchForm.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False 
  12.    ScaleHeight     =   262
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   436
  15.    Begin VB.CommandButton Command1 
  16.       Caption         =   "COPY"
  17.       Height          =   420
  18.       Left            =   5400
  19.       TabIndex        =   3
  20.       Top             =   1530
  21.       Width           =   870
  22.    End
  23.    Begin VB.FileListBox File1 
  24.       BackColor       =   &H00E0E0E0&
  25.       ForeColor       =   &H00800000&
  26.       Height          =   2820
  27.       Left            =   2745
  28.       Pattern         =   "*.ico"
  29.       TabIndex        =   2
  30.       Top             =   945
  31.       Width           =   2490
  32.    End
  33.    Begin VB.DirListBox Dir1 
  34.       BackColor       =   &H00E0E0E0&
  35.       ForeColor       =   &H00800000&
  36.       Height          =   2340
  37.       Left            =   135
  38.       TabIndex        =   1
  39.       Top             =   1440
  40.       Width           =   2490
  41.    End
  42.    Begin VB.DriveListBox Drive1 
  43.       BackColor       =   &H00E0E0E0&
  44.       ForeColor       =   &H00800000&
  45.       Height          =   315
  46.       Left            =   135
  47.       TabIndex        =   0
  48.       Top             =   945
  49.       Width           =   2490
  50.    End
  51.    Begin VB.Label Label2 
  52.       BorderStyle     =   1  'Fixed Single
  53.       Caption         =   "Label2"
  54.       ForeColor       =   &H000000C0&
  55.       Height          =   555
  56.       Left            =   135
  57.       TabIndex        =   5
  58.       Top             =   360
  59.       Width           =   6270
  60.    End
  61.    Begin VB.Label Label1 
  62.       BackColor       =   &H00C0C0C0&
  63.       BorderStyle     =   1  'Fixed Single
  64.       Caption         =   "Label1"
  65.       ForeColor       =   &H000000C0&
  66.       Height          =   285
  67.       Left            =   135
  68.       TabIndex        =   4
  69.       Top             =   45
  70.       Width           =   6270
  71.    End
  72.    Begin VB.Image Image1 
  73.       Height          =   480
  74.       Left            =   5580
  75.       Top             =   945
  76.       Width           =   480
  77.    End
  78. Attribute VB_Name = "SearchForm"
  79. Attribute VB_GlobalNameSpace = False
  80. Attribute VB_Creatable = False
  81. Attribute VB_PredeclaredId = True
  82. Attribute VB_Exposed = False
  83. Private Sub Command1_Click() 'copy to temp
  84. On Error GoTo mkdir0
  85. MkDir IBpath$ & "\" & "_tempicons"
  86. IconBook.Dir1.Refresh
  87. mkdir0:
  88. FileCopy Label1.Caption, IBpath & "\" & "_tempicons" & "\" & File1.List(File1.ListIndex)
  89. Command1.Enabled = False
  90. IconBook.File1.Refresh
  91. End Sub
  92. Private Sub Dir1_Change()
  93. File1.Path = Dir1.Path
  94. Label2.Caption = "Icons in " & Dir1.Path & ": " & File1.ListCount
  95. Label1.Caption = Dir1.Path
  96. CopyEnabled
  97. End Sub
  98. Private Sub Dir1_Click()
  99. File1.Path = Dir1.List(Dir1.ListIndex)
  100. Label2.Caption = "Icons in " & File1.Path & ": " & File1.ListCount
  101. Label1.Caption = Dir1.List(Dir1.ListIndex)
  102. CopyEnabled
  103. End Sub
  104. Private Sub Drive1_Change()
  105. On Error GoTo Dri1
  106. Dir1.Path = Drive1.Drive
  107. File1.Path = Dir1.Path
  108. Label2.Caption = "Icons in " & Dir1.Path & ": " & File1.ListCount
  109. Label1.Caption = Drive1.Drive
  110. CopyEnabled
  111. Exit Sub
  112. Dri1:
  113. Temp$ = MsgBox("There has been an error !", vbCritical + vbOKOnly, "IconAlbum - System message")
  114. End Sub
  115. Private Sub File1_Click()
  116. If Right(File1.Path, 1) = "\" Then
  117. Image1.Picture = LoadPicture(File1.Path + File1.List(File1.ListIndex))
  118. Label1.Caption = File1.Path + File1.List(File1.ListIndex)
  119. Image1.Picture = LoadPicture(File1.Path + "\" + File1.List(File1.ListIndex))
  120. Label1.Caption = File1.Path + "\" + File1.List(File1.ListIndex)
  121. End If
  122. CopyEnabled
  123. End Sub
  124. Private Sub Form_Activate()
  125. Command1.Enabled = False
  126. End Sub
  127. Private Sub Form_Load()
  128. SearchForm.Move (Screen.Width - SearchForm.Width) / 2, (Screen.Height - SearchForm.Height) / 2
  129. Drive1.Drive = "c:"
  130. Dir1.Path = "c:\"
  131. File1.Path = "c:\"
  132. Label1.Caption = ""
  133. End Sub
  134. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  135. Cancel = True
  136. SearchForm.Hide
  137. IconBook.Show
  138. End Sub
  139. Private Sub CopyEnabled()
  140. If File1.ListIndex = -1 Then
  141. Command1.Enabled = False
  142. Image1.Picture = LoadPicture("")
  143. Command1.Enabled = True
  144. End If
  145. End Sub
  146.