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

  1. VERSION 5.00
  2. Begin VB.Form Form2 
  3.    BackColor       =   &H00000000&
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "Form2"
  6.    ClientHeight    =   5775
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   8100
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   5775
  12.    ScaleWidth      =   8100
  13.    ShowInTaskbar   =   0   'False
  14.    StartUpPosition =   3  'Windows Default
  15.    WindowState     =   2  'Maximized
  16.    Begin VB.Timer Timer1 
  17.       Interval        =   5000
  18.       Left            =   3840
  19.       Top             =   480
  20.    End
  21.    Begin VB.Label Label1 
  22.       AutoSize        =   -1  'True
  23.       BackStyle       =   0  'Transparent
  24.       Caption         =   "Please Wait"
  25.       BeginProperty Font 
  26.          Name            =   "MS Sans Serif"
  27.          Size            =   9.75
  28.          Charset         =   0
  29.          Weight          =   700
  30.          Underline       =   0   'False
  31.          Italic          =   0   'False
  32.          Strikethrough   =   0   'False
  33.       EndProperty
  34.       ForeColor       =   &H0000FFFF&
  35.       Height          =   240
  36.       Left            =   840
  37.       TabIndex        =   0
  38.       Top             =   4200
  39.       Width           =   1275
  40.    End
  41.    Begin VB.Image Image1 
  42.       Height          =   1695
  43.       Left            =   120
  44.       Top             =   120
  45.       Width           =   3495
  46.    End
  47. Attribute VB_Name = "Form2"
  48. Attribute VB_GlobalNameSpace = False
  49. Attribute VB_Creatable = False
  50. Attribute VB_PredeclaredId = True
  51. Attribute VB_Exposed = False
  52. '*********************************************************************************
  53. 'Slide Show v1.0
  54. 'Author: Dustin Davis
  55. 'Bootleg Software Inc.
  56. 'http://www.warpnet.org/bsi
  57. 'Slide Show has alot of things it can do, Add as many images as u want,
  58. 'add Bitmaps, Jpeg Files and GIF files, mix em up even
  59. 'You can add ALL of the image file listed with one click of a button
  60. 'One click remove item from list
  61. 'empty list with one click
  62. 'Auto start show on load
  63. 'Pause the show
  64. 'timer settings and so on.
  65. 'Please do not steal this code! It was not coded by you. If you use it,
  66. 'please give me proper credit for it!
  67. 'ENJOY!!
  68. 'This is the form for the show!
  69. '*********************************************************************************
  70. Dim TotalImages As Long
  71. Dim temp As String
  72. Dim CurrentImg As Long
  73. Public PauseShow As Boolean
  74. Private Sub Form_KeyPress(KeyAscii As Integer)
  75. 'exit the show
  76. Unload Me
  77. End Sub
  78. Private Sub Form_Load()
  79. Form1.Visible = False
  80. PauseShow = False
  81. Label1.Top = 0
  82. Label1.Left = 0
  83. 'see if showfile is enabled
  84. If Form1.Check1.Value = Unchecked Then
  85.     Label1.Visible = False
  86. End If
  87. 'set timer interval
  88. With Timer1
  89.     .Enabled = False
  90.     .Interval = GetSetting("SlideShow", "settings", "delay", "5")
  91.     .Interval = Timer1.Interval * 1000
  92.     .Enabled = True
  93. End With
  94. 'get some settings
  95. TotalImages = GetSetting("SlideShow", "pictures", "HowMany", "0")
  96. CurrentImg = 1
  97. 'set positions
  98. With Form2
  99.     .Top = 0
  100.     .Left = 0
  101. End With
  102. End Sub
  103. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  104. 'on mouse click, see if the show should exit, or pause or resume!
  105. If Button = 1 Then 'exit
  106.     Unload Me
  107. ElseIf Button = 2 Then 'pause / resume
  108.     If PauseShow = False Then 'pause
  109.         Label1.Caption = "Paused on " & temp
  110.         PauseShow = True
  111.         Exit Sub
  112.     Else 'resume
  113.         Label1.Caption = "Resumeing on " & temp
  114.         PauseShow = False
  115.         Exit Sub
  116.     End If
  117. End If
  118. End Sub
  119. Private Sub Form_Unload(Cancel As Integer)
  120. 'show form1 again
  121. Form1.Visible = True
  122. End Sub
  123. Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  124. 'on mouse click, see if the show should exit, or pause or resume!
  125. If Button = 1 Then 'exit
  126.     Unload Me
  127. ElseIf Button = 2 Then 'pause / resume
  128.     If PauseShow = False Then 'pause
  129.         Label1.Caption = "Paused on " & temp
  130.         PauseShow = True
  131.         Exit Sub
  132.     Else 'resume
  133.         Label1.Caption = "Resumeing on " & temp
  134.         PauseShow = False
  135.         Exit Sub
  136.     End If
  137. End If
  138. End Sub
  139. Private Sub Timer1_Timer()
  140. 'this shows all the pictures, etc.
  141. Dim ImgWidth As Long
  142. Dim ImgHalfWidth As Long
  143. Dim ImgHeight As Long
  144. Dim ImgHalfHeight As Long
  145. 'see if the show is paused or not
  146. If PauseShow = True Then
  147.         Exit Sub
  148.     End If
  149. Image1.Visible = False 'turns it off so when it resizes it wont flicker
  150. 'get image location
  151.     temp = GetSetting("SlideShow", "pictures", CurrentImg, "0")
  152.     'load picture
  153.     Image1.Picture = LoadPicture(temp)
  154.     'show image location
  155.     Label1.Caption = temp
  156.     'start centering proccess
  157.     ImgWidth = Image1.Width
  158.     ImgHalfWidth = ImgWidth / 2
  159.     ImgHeight = Image1.Height
  160.     ImgHalfHeight = ImgHeight / 2
  161.     Image1.Top = (Form2.Height / 2) - ImgHalfHeight
  162.     Image1.Left = (Form2.Width / 2) - ImgHalfWidth
  163.     'end centering proccess - now the image is centered perfectly
  164.     Image1.Visible = True 'show the picture now
  165.     CurrentImg = CurrentImg + 1
  166.     'check if it should loop now
  167.     If CurrentImg >= TotalImages Then
  168.         CurrentImg = 1
  169.     Else
  170.         DoEvents
  171.     End If
  172.     DoEvents
  173. End Sub
  174.