home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / aslide1a / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-09-26  |  12.0 KB  |  365 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Slide Show v1.0"
  5.    ClientHeight    =   7530
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   8445
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   7530
  13.    ScaleWidth      =   8445
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.CommandButton Command6 
  16.       Caption         =   "Add All"
  17.       Height          =   375
  18.       Left            =   2640
  19.       TabIndex        =   15
  20.       Top             =   3840
  21.       Width           =   1215
  22.    End
  23.    Begin VB.CheckBox Check3 
  24.       Caption         =   "Auto Start Slide Show on Load"
  25.       Height          =   195
  26.       Left            =   3960
  27.       TabIndex        =   14
  28.       Top             =   6960
  29.       Width           =   2655
  30.    End
  31.    Begin VB.TextBox Text1 
  32.       Height          =   285
  33.       Left            =   3240
  34.       MaxLength       =   2
  35.       TabIndex        =   13
  36.       Text            =   "5"
  37.       Top             =   7200
  38.       Width           =   375
  39.    End
  40.    Begin VB.CommandButton Command3 
  41.       Caption         =   "Set Timer"
  42.       Height          =   285
  43.       Left            =   4440
  44.       TabIndex        =   12
  45.       Top             =   7200
  46.       Width           =   1215
  47.    End
  48.    Begin VB.CheckBox Check1 
  49.       Caption         =   "Show File Name During Slide Show"
  50.       Height          =   255
  51.       Left            =   120
  52.       TabIndex        =   11
  53.       Top             =   6960
  54.       Width           =   2895
  55.    End
  56.    Begin VB.CheckBox Check2 
  57.       Caption         =   "Auto Remove"
  58.       Height          =   255
  59.       Left            =   2640
  60.       TabIndex        =   10
  61.       Top             =   3600
  62.       Width           =   1335
  63.    End
  64.    Begin VB.CommandButton Command5 
  65.       Caption         =   "Start the Slide Show!!"
  66.       BeginProperty Font 
  67.          Name            =   "MS Sans Serif"
  68.          Size            =   12
  69.          Charset         =   0
  70.          Weight          =   700
  71.          Underline       =   0   'False
  72.          Italic          =   0   'False
  73.          Strikethrough   =   0   'False
  74.       EndProperty
  75.       Height          =   1215
  76.       Left            =   2640
  77.       TabIndex        =   9
  78.       Top             =   360
  79.       Width           =   1215
  80.    End
  81.    Begin VB.CommandButton Command4 
  82.       Caption         =   "Clear List"
  83.       Height          =   375
  84.       Left            =   2640
  85.       TabIndex        =   6
  86.       Top             =   4560
  87.       Width           =   1215
  88.    End
  89.    Begin VB.DirListBox Dir1 
  90.       Height          =   2340
  91.       Left            =   120
  92.       TabIndex        =   5
  93.       Top             =   360
  94.       Width           =   2415
  95.    End
  96.    Begin VB.DriveListBox Drive1 
  97.       Height          =   315
  98.       Left            =   120
  99.       TabIndex        =   4
  100.       Top             =   0
  101.       Width           =   2415
  102.    End
  103.    Begin VB.CommandButton Command2 
  104.       Caption         =   "<-"
  105.       BeginProperty Font 
  106.          Name            =   "MS Sans Serif"
  107.          Size            =   9.75
  108.          Charset         =   0
  109.          Weight          =   700
  110.          Underline       =   0   'False
  111.          Italic          =   0   'False
  112.          Strikethrough   =   0   'False
  113.       EndProperty
  114.       Height          =   375
  115.       Left            =   2640
  116.       TabIndex        =   3
  117.       Top             =   3240
  118.       Width           =   1215
  119.    End
  120.    Begin VB.CommandButton Command1 
  121.       Caption         =   "->"
  122.       Default         =   -1  'True
  123.       BeginProperty Font 
  124.          Name            =   "MS Sans Serif"
  125.          Size            =   9.75
  126.          Charset         =   0
  127.          Weight          =   700
  128.          Underline       =   0   'False
  129.          Italic          =   0   'False
  130.          Strikethrough   =   0   'False
  131.       EndProperty
  132.       Height          =   375
  133.       Left            =   2640
  134.       TabIndex        =   2
  135.       Top             =   2760
  136.       Width           =   1215
  137.    End
  138.    Begin VB.ListBox List1 
  139.       Height          =   6885
  140.       ItemData        =   "Form1.frx":0000
  141.       Left            =   3960
  142.       List            =   "Form1.frx":0002
  143.       TabIndex        =   1
  144.       ToolTipText     =   "List of images to play"
  145.       Top             =   0
  146.       Width           =   4335
  147.    End
  148.    Begin VB.FileListBox File1 
  149.       Height          =   4185
  150.       Hidden          =   -1  'True
  151.       Left            =   120
  152.       OLEDragMode     =   1  'Automatic
  153.       OLEDropMode     =   1  'Manual
  154.       System          =   -1  'True
  155.       TabIndex        =   0
  156.       Top             =   2760
  157.       Width           =   2415
  158.    End
  159.    Begin VB.Label Label2 
  160.       Caption         =   "Seconds"
  161.       Height          =   255
  162.       Left            =   3720
  163.       TabIndex        =   8
  164.       Top             =   7215
  165.       Width           =   735
  166.    End
  167.    Begin VB.Label Label1 
  168.       Caption         =   "Enter Number of Seconds to show picture"
  169.       Height          =   255
  170.       Left            =   120
  171.       TabIndex        =   7
  172.       Top             =   7215
  173.       Width           =   3015
  174.    End
  175. Attribute VB_Name = "Form1"
  176. Attribute VB_GlobalNameSpace = False
  177. Attribute VB_Creatable = False
  178. Attribute VB_PredeclaredId = True
  179. Attribute VB_Exposed = False
  180. '*********************************************************************************
  181. 'Slide Show v1.0
  182. 'Author: Dustin Davis
  183. 'Bootleg Software Inc.
  184. 'http://www.warpnet.org/bsi
  185. 'Slide Show has alot of things it can do, Add as many images as u want,
  186. 'add Bitmaps, Jpeg Files and GIF files, mix em up even
  187. 'You can add ALL of the image file listed with one click of a button
  188. 'One click remove item from list
  189. 'empty list with one click
  190. 'Auto start show on load
  191. 'Pause the show
  192. 'timer settings and so on.
  193. 'Please do not steal this code! It was not coded by you. If you use it,
  194. 'please give me proper credit for it!
  195. 'ENJOY!!
  196. 'This is the form for Settings!
  197. '*********************************************************************************
  198. Private Sub Check1_Click()
  199. 'this will turn On/Off the label on form2 during the show
  200. If Check1.Value = Checked Then
  201.     SaveSetting "SlideShow", "settings", "showfile", "1"
  202.     Exit Sub
  203. ElseIf Check1.Value = Unchecked Then
  204.     SaveSetting "SlideShow", "settings", "showfile", "0"
  205.     Exit Sub
  206. End If
  207. End Sub
  208. Private Sub Check3_Click()
  209. 'this will turn On/Off Auto Start. So if auto start is On or checked
  210. 'then when the program loads, it will automaticly start the show
  211. If Check3.Value = Checked Then
  212.     SaveSetting "SlideShow", "settings", "autostart", "1"
  213.     Exit Sub
  214. ElseIf Check3.Value = Unchecked Then
  215.     SaveSetting "SlideShow", "settings", "autostart", "0"
  216.     Exit Sub
  217. End If
  218. End Sub
  219. Private Sub Command1_Click()
  220. 'this will add pictures to the show list
  221. Dim FilePath As String
  222. Dim pic As String
  223. Dim temp As String
  224. Dim length As Integer
  225. Dim where As Integer
  226. 'This will get the name and path of the picture
  227. FilePath = File1.Path + "\" + File1.FileName
  228. 'this will check to see if the file is a picture file or not
  229. pic = Dir1.Path & "\" & File1.FileName
  230. temp = File1.FileName
  231. length = Len(temp)
  232. where = InStr(temp, ".")
  233. temp = Right$(temp, length - where)
  234. If temp = "bmp" Then 'if it is a bitmap then add to list
  235. List1.AddItem FilePath
  236. SaveSetting "SlideShow", "pictures", "HowMany", List1.ListCount
  237. SaveSetting "SlideShow", "pictures", List1.ListCount, FilePath
  238. ElseIf temp = "jpg" Then 'if it is a jpg file then add to list
  239. List1.AddItem FilePath
  240. SaveSetting "SlideShow", "pictures", "HowMany", List1.ListCount
  241. SaveSetting "SlideShow", "pictures", List1.ListCount, FilePath
  242. ElseIf temp = "gif" Then 'if it is a gif file then add to list
  243. List1.AddItem FilePath
  244. SaveSetting "SlideShow", "pictures", "HowMany", List1.ListCount
  245. SaveSetting "SlideShow", "pictures", List1.ListCount, FilePath
  246. ElseIf temp = "BMP" Then 'if it is a bitmap then add to list
  247. List1.AddItem FilePath
  248. SaveSetting "SlideShow", "pictures", "HowMany", List1.ListCount
  249. SaveSetting "SlideShow", "pictures", List1.ListCount, FilePath
  250. ElseIf temp = "JPG" Then 'if it is a jpg file then add to list
  251. List1.AddItem FilePath
  252. SaveSetting "SlideShow", "pictures", "HowMany", List1.ListCount
  253. SaveSetting "SlideShow", "pictures", List1.ListCount, FilePath
  254. ElseIf temp = "GIF" Then 'if it is a jpg file then add to list
  255. List1.AddItem FilePath
  256. SaveSetting "SlideShow", "pictures", "HowMany", List1.ListCount
  257. SaveSetting "SlideShow", "pictures", List1.ListCount, FilePath
  258. Else 'if it isnt a bitmap, jpg or gif file then exit
  259.     'MsgBox "This is not a picture file!!" & vbCrLf & "Must be a .JPG, .BMP or .GIF Format!", vbExclamation
  260.     Exit Sub
  261. End If
  262. End Sub
  263. Private Sub Command2_Click()
  264. 'this will remove the selected picture from the list!
  265. SaveSetting "Slideshow", "pictures", List1.ListIndex, ""
  266. List1.RemoveItem List1.ListIndex
  267. End Sub
  268. Private Sub Command3_Click()
  269. 'this will set the timer
  270. If Text1.Text > 65 Then 'if over 65 seconds, it wont work!
  271.     MsgBox "Please Enter a number between 1-65"
  272.     Exit Sub
  273. End If
  274. SaveSetting "SlideShow", "settings", "delay", Text1.Text 'set timer
  275. End Sub
  276. Private Sub Command4_Click()
  277. 'this will clear ALL of the picture settings and locations
  278. Dim TotalImages As Long
  279. Dim CurrentImg As Long
  280. TotalImages = GetSetting("SlideShow", "pictures", "HowMany", "0")
  281. CurrentImg = 0
  282. List1.Clear
  283. Do Until CurrentImg = TotalImages
  284.     CurrentImg = CurrentImg + 1
  285.     SaveSetting "SlideShow", "pictures", CurrentImg, ""
  286. SaveSetting "SlideShow", "pictures", "HowMany", "0"
  287. End Sub
  288. Private Sub Command5_Click()
  289. 'this opens the show
  290. Form2.Visible = True
  291. End Sub
  292. Private Sub Command6_Click()
  293. 'this adds all of the picture files to the list, will not add anything else
  294. Dim TotalFiles As Long
  295. Dim CurrentFile As Long
  296. CurrentFile = 0
  297. TotalFiles = File1.ListCount
  298. Do Until CurrentFile >= TotalFiles
  299.     File1.ListIndex = CurrentFile
  300.     CurrentFile = CurrentFile + 1
  301.     Call Command1_Click 'call this to scan the files, if good, then add to list
  302. End Sub
  303. Private Sub Dir1_Change()
  304. 'this will change the path of the files
  305. File1.Path = Dir1.Path
  306. End Sub
  307. Private Sub Drive1_Change()
  308. 'this will change the path of the folders
  309. On Error GoTo errDrive
  310. Dir1.Path = Drive1.Drive
  311. errDrive:
  312.     If Err.Number = 68 Then 'this means that the drive isnt accessable!
  313.         MsgBox "Drive Not Ready!", vbOKOnly
  314.         Exit Sub
  315.     Else
  316.         Exit Sub
  317.     End If
  318. End Sub
  319. Private Sub Form_Load()
  320. Dim TotalImages As Long
  321. Dim CurrentImg As Long
  322. Dim PicturePath As String
  323. 'start listing what is in the current list
  324. CurrentImg = 0
  325. TotalImages = GetSetting("SlideShow", "pictures", "HowMany", "0")
  326. If TotalImages = 0 Then
  327.     Exit Sub
  328.     Do Until CurrentImg >= TotalImages
  329.         CurrentImg = CurrentImg + 1
  330.         PicturePath = GetSetting("SlideShow", "pictures", CurrentImg, "0")
  331.         If PicturePath = "0" Then
  332.             List1.AddItem "Empty"
  333.         Else
  334.             List1.AddItem PicturePath
  335.         End If
  336.     Loop
  337. End If
  338. 'end listing of current list
  339. 'show timer setting
  340. Text1.Text = GetSetting("SlideShow", "settings", "delay", "5")
  341. 'check if autostart is enabled
  342. If GetSetting("SlideShow", "settings", "autostart", "0") = 1 Then
  343.     Check3.Value = Checked
  344. End If
  345. 'check if showfile is enabled
  346. If GetSetting("SlideShow", "settings", "showfile", "1") = 1 Then
  347.     Check1.Value = Checked
  348. End If
  349. 'if auto start is enabled then start the show!
  350. If Check3.Value = Checked Then
  351.     Form2.Visible = True
  352.     Form1.Visible = False
  353. End If
  354. End Sub
  355. Private Sub List1_Click()
  356. 'this is for the auto remove so u dont have to push the button!
  357. 'just click and erase!! :)
  358. If Check2.Value = Checked Then
  359.     SaveSetting "Slideshow", "pictures", List1.ListIndex, ""
  360.     List1.RemoveItem List1.ListIndex
  361. ElseIf Check2.Value = Unchecked Then
  362.     DoEvents
  363. End If
  364. End Sub
  365.