home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / startu1a / form2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-31  |  15.8 KB  |  597 lines

  1. VERSION 5.00
  2. Begin VB.Form Form2 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Form Preview"
  5.    ClientHeight    =   2415
  6.    ClientLeft      =   45
  7.    ClientTop       =   285
  8.    ClientWidth     =   3255
  9.    LinkTopic       =   "Form2"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   2415
  13.    ScaleWidth      =   3255
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton Command1 
  17.       Caption         =   "Shutdown"
  18.       Height          =   255
  19.       Left            =   120
  20.       TabIndex        =   1
  21.       Top             =   2040
  22.       Width           =   3015
  23.    End
  24.    Begin VB.Timer Timer2 
  25.       Enabled         =   0   'False
  26.       Interval        =   1
  27.       Left            =   2280
  28.       Top             =   0
  29.    End
  30.    Begin VB.Timer Timer1 
  31.       Interval        =   1
  32.       Left            =   2760
  33.       Top             =   0
  34.    End
  35.    Begin VB.Label Label1 
  36.       Caption         =   $"Form2.frx":0000
  37.       Height          =   1815
  38.       Left            =   120
  39.       TabIndex        =   0
  40.       Top             =   120
  41.       Width           =   3015
  42.    End
  43. Attribute VB_Name = "Form2"
  44. Attribute VB_GlobalNameSpace = False
  45. Attribute VB_Creatable = False
  46. Attribute VB_PredeclaredId = True
  47. Attribute VB_Exposed = False
  48. Dim Xtra1 As Long
  49. Dim Xtra2 As Long
  50. Dim Xtra3 As Long
  51. Dim Xtra4 As Long
  52. Dim Xtra5 As Long
  53. Dim Start As Boolean
  54. Dim Amount As Integer
  55. Dim Ricochet As Boolean
  56. Dim CurPos As Integer
  57. Private Sub Command1_Click()
  58. Start = True
  59. Timer1.Enabled = False
  60. Timer2.Enabled = True
  61. End Sub
  62. Private Sub Form_Activate()
  63. Form2.Width = NormalW
  64. Form2.Height = NormalH
  65. Form2.Move (Screen.Width - Form2.Width) / 2, (Screen.Height - Form2.Height) / 2
  66. Xtra1 = Form2.Width
  67. Xtra2 = Form2.Height
  68. Xtra3 = Form2.Left
  69. Xtra4 = Form2.Top
  70. Start = True
  71. Timer1.Enabled = True
  72. End Sub
  73. Private Sub Form_Load()
  74. NormalW = Form2.Width
  75. NormalH = Form2.Height
  76. Xtra1 = Form2.Width
  77. Xtra2 = Form2.Height
  78. Xtra3 = Form2.Left
  79. Xtra4 = Form2.Top
  80. Start = True
  81. End Sub
  82. Private Sub Form_Unload(Cancel As Integer)
  83. Cancel = 1
  84. Command1_Click
  85. End Sub
  86. Private Sub Timer1_Timer()
  87. If Startup = 1 Then
  88. 'Zoom In
  89.   If Start = True Then
  90.   Form2.Width = 0
  91.   Form2.Height = 0
  92.   Start = False
  93.   End If
  94. Amount = 75
  95. Form2.Move (Screen.Width - Form2.Width) / 2, (Screen.Height - Form2.Height) / 2
  96.   If Form2.Width + Amount > Xtra1 And Form2.Height + Amount > Xtra2 Then
  97.   Form2.Width = Xtra1
  98.   Form2.Height = Xtra2
  99.   GoTo EndE
  100.   ElseIf Form2.Width + Amount > Xtra1 Then
  101.   Form2.Width = Xtra1
  102.   Form2.Height = Form2.Height + Amount
  103.   ElseIf Form2.Height + Amount > Xtra2 Then
  104.   Form2.Height = Xtra2
  105.   Form2.Width = Form2.Width + Amount
  106.   Else
  107.   Form2.Height = Form2.Height + Amount
  108.   Form2.Width = Form2.Width + Amount
  109.   End If
  110. Form2.Move (Screen.Width - Form2.Width) / 2, (Screen.Height - Form2.Height) / 2
  111. ElseIf Startup = 2 Then
  112. 'Zoom Out
  113.   If Start = True Then
  114.   Form2.Width = Screen.Width
  115.   Form2.Height = Screen.Height
  116.   Form2.Left = 0
  117.   Form2.Top = 0
  118.   Start = False
  119.   End If
  120. Amount = 100
  121. Form2.Move (Screen.Width - Form2.Width) / 2, (Screen.Height - Form2.Height) / 2
  122.   If Form2.Width - Amount < Xtra1 And Form2.Height - Amount < Xtra2 Then
  123.   Form2.Width = Xtra1
  124.   Form2.Height = Xtra2
  125.   GoTo EndE
  126.   ElseIf Form2.Width - Amount < Xtra1 Then
  127.   Form2.Width = Xtra1
  128.   Form2.Height = Form2.Height - Amount
  129.   ElseIf Form2.Height - Amount < Xtra2 Then
  130.   Form2.Height = Xtra2
  131.   Form2.Width = Form2.Width - Amount
  132.   Else
  133.   Form2.Height = Form2.Height - Amount
  134.   Form2.Width = Form2.Width - Amount
  135.   End If
  136. Form2.Move (Screen.Width - Form2.Width) / 2, (Screen.Height - Form2.Height) / 2
  137. ElseIf Startup = 3 Then
  138. 'Slide Left
  139. Amount = 75
  140.   If Start = True Then
  141.   Form2.Left = Screen.Width
  142.   Start = False
  143.   End If
  144.   If Form2.Left - Amount < (Screen.Width - Form2.Width) / 2 Then
  145.   Form2.Left = (Screen.Width - Form2.Width) / 2
  146.   GoTo EndE
  147.   Else
  148.   Form2.Left = Form2.Left - Amount
  149.   End If
  150. ElseIf Startup = 4 Then
  151. 'Slide Up
  152. Amount = 75
  153.   If Start = True Then
  154.   Form2.Top = Screen.Height
  155.   Start = False
  156.   End If
  157.   If Form2.Top - Amount < (Screen.Height - Form2.Height) / 2 Then
  158.   Form2.Top = (Screen.Height - Form2.Height) / 2
  159.   GoTo EndE
  160.   Else
  161.   Form2.Top = Form2.Top - Amount
  162.   End If
  163. ElseIf Startup = 5 Then
  164. 'Slide Right
  165. Amount = 75
  166.   If Start = True Then
  167.   Form2.Left = 0 - Form2.Width
  168.   Start = False
  169.   End If
  170.   If Form2.Left + Amount > (Screen.Width - Form2.Width) / 2 Then
  171.   Form2.Left = (Screen.Width - Form2.Width) / 2
  172.   GoTo EndE
  173.   Else
  174.   Form2.Left = Form2.Left + Amount
  175.   End If
  176. ElseIf Startup = 6 Then
  177. 'Slide Down
  178. Amount = 75
  179.   If Start = True Then
  180.   Form2.Top = 0 - Form2.Height
  181.   Start = False
  182.   End If
  183.   If Form2.Top + Amount > (Screen.Height - Form2.Height) / 2 Then
  184.   Form2.Top = (Screen.Height - Form2.Height) / 2
  185.   GoTo EndE
  186.   Else
  187.   Form2.Top = Form2.Top + Amount
  188.   End If
  189. ElseIf Startup = 7 Then
  190. 'Bounce Left
  191.   If Start = True Then
  192.   Form2.Left = Screen.Width
  193.   Form2.Top = 0
  194.   Ricochet = False
  195.   Start = False
  196.   Amount = 300
  197.   End If
  198.   If Ricochet = False Then
  199.     If Form2.Left < 0 Then
  200.     Ricochet = True
  201.     Else
  202.     Form2.Left = Form2.Left - Amount
  203.     Form2.Top = Form2.Top + (Amount / 8)
  204.     End If
  205.   Else
  206.     If Form2.Left + Amount > (Screen.Width - Form2.Width) / 2 Then
  207.     Form2.Left = (Screen.Width - Form2.Width) / 2
  208.     GoTo EndE
  209.     Else
  210.     Amount = 150
  211.     Form2.Left = Form2.Left + Amount
  212.     Form2.Top = Form2.Top + (Amount / 3)
  213.     End If
  214.   End If
  215. ElseIf Startup = 8 Then
  216. 'Bounce Right
  217.   If Start = True Then
  218.   Form2.Left = 0
  219.   Form2.Top = Screen.Height - Form2.Height
  220.   Ricochet = False
  221.   Start = False
  222.   Amount = 300
  223.   End If
  224.   If Ricochet = False Then
  225.     If Form2.Left > Screen.Width - Form2.Width Then
  226.     Ricochet = True
  227.     Else
  228.     Form2.Left = Form2.Left + Amount
  229.     Form2.Top = Form2.Top - (Amount / 8)
  230.     End If
  231.   Else
  232.     If Form2.Left - Amount < (Screen.Width - Form2.Width) / 2 Then
  233.     Form2.Left = (Screen.Width - Form2.Width) / 2
  234.     GoTo EndE
  235.     Else
  236.     Amount = 150
  237.     Form2.Left = Form2.Left - Amount
  238.     Form2.Top = Form2.Top - (Amount / 2)
  239.     End If
  240.   End If
  241. ElseIf Startup = 9 Then
  242. 'Up/Down
  243. Amount = 400
  244.   If Start = True Then
  245.   CurPos = 1
  246.   Start = False
  247.   Ricochet = True
  248.   End If
  249.   If Ricochet = False Then
  250.     If CurPos = 2 And Form2.Top + Amount > (Screen.Height - Form2.Height) / 2 Then
  251.     GoTo EndE
  252.     Else
  253.       If Form2.Top + Form2.Height > Screen.Height Then
  254.       CurPos = CurPos + 1
  255.       Ricochet = True
  256.       Else
  257.       Form2.Top = Form2.Top + Amount
  258.       End If
  259.     End If
  260.   Else
  261.     If Form2.Top < 0 Then
  262.     Ricochet = False
  263.     Else
  264.     Form2.Top = Form2.Top - Amount
  265.     End If
  266.   End If
  267. ElseIf Startup = 10 Then
  268. 'Left/Right
  269. Amount = 400
  270.   If Start = True Then
  271.   CurPos = 1
  272.   Start = False
  273.   Ricochet = True
  274.   End If
  275.   If Ricochet = False Then
  276.     If CurPos = 2 And Form2.Left + Amount > (Screen.Width - Form2.Width) / 2 Then
  277.     GoTo EndE
  278.     Else
  279.       If Form2.Left + Form2.Width > Screen.Width Then
  280.       CurPos = CurPos + 1
  281.       Ricochet = True
  282.       Else
  283.       Form2.Left = Form2.Left + Amount
  284.       End If
  285.     End If
  286.   Else
  287.     If Form2.Left < 0 Then
  288.     Ricochet = False
  289.     Else
  290.     Form2.Left = Form2.Left - Amount
  291.     End If
  292.   End If
  293. ElseIf Startup = 11 Then
  294. 'Left-Up
  295. Xtra5 = 50
  296.   If Start = True Then
  297.   Form2.Top = Screen.Height
  298.   Form2.Left = Screen.Width
  299.   Start = False
  300.   End If
  301.   If Form2.Left - ((Screen.Width - Form2.Width) / 2) / Xtra5 < (Screen.Width - Form2.Width) / 2 And Form2.Top - ((Screen.Height - Form2.Height) / 2) / Xtra5 < (Screen.Height - Form2.Height) / 2 Then
  302.   Form2.Left = (Screen.Width - Form2.Width) / 2
  303.   Form2.Top = (Screen.Height - Form2.Height) / 2
  304.   GoTo EndE
  305.   Else
  306.   Amount = ((Screen.Width - Form2.Width) / 2) / Xtra5
  307.   Form2.Left = Form2.Left - Amount
  308.   Amount = ((Screen.Height - Form2.Height) / 2) / Xtra5
  309.   Form2.Top = Form2.Top - Amount
  310.   End If
  311. ElseIf Startup = 12 Then
  312. 'Left-Down
  313. Xtra5 = 50
  314.   If Start = True Then
  315.   Form2.Top = 0 - Form2.Height
  316.   Form2.Left = Screen.Width
  317.   Start = False
  318.   End If
  319.   If Form2.Left - ((Screen.Width - Form2.Width) / 2) / Xtra5 < (Screen.Width - Form2.Width) / 2 And Form2.Top + ((Screen.Height - Form2.Height) / 2) / Xtra5 > (Screen.Height - Form2.Height) / 2 Then
  320.   Form2.Left = (Screen.Width - Form2.Width) / 2
  321.   Form2.Top = (Screen.Height - Form2.Height) / 2
  322.   GoTo EndE
  323.   Else
  324.   Amount = ((Screen.Width - Form2.Width) / 2) / Xtra5
  325.   Form2.Left = Form2.Left - Amount
  326.   Amount = ((Screen.Height - Form2.Height) / 2) / Xtra5
  327.   Form2.Top = Form2.Top + Amount
  328.   End If
  329. ElseIf Startup = 13 Then
  330. 'Right-Up
  331. Xtra5 = 50
  332.   If Start = True Then
  333.   Form2.Top = Screen.Height
  334.   Form2.Left = 0 - Form2.Width
  335.   Start = False
  336.   End If
  337.   If Form2.Left + ((Screen.Width - Form2.Width) / 2) / Xtra5 > (Screen.Width - Form2.Width) / 2 And Form2.Top - ((Screen.Height - Form2.Height) / 2) / Xtra5 < (Screen.Height - Form2.Height) / 2 Then
  338.   Form2.Left = (Screen.Width - Form2.Width) / 2
  339.   Form2.Top = (Screen.Height - Form2.Height) / 2
  340.   GoTo EndE
  341.   Else
  342.   Amount = ((Screen.Width - Form2.Width) / 2) / Xtra5
  343.   Form2.Left = Form2.Left + Amount
  344.   Amount = ((Screen.Height - Form2.Height) / 2) / Xtra5
  345.   Form2.Top = Form2.Top - Amount
  346.   End If
  347. ElseIf Startup = 14 Then
  348. 'Right-Down
  349. Xtra5 = 50
  350.   If Start = True Then
  351.   Form2.Top = 0 - Form2.Height
  352.   Form2.Left = 0 - Form2.Width
  353.   Start = False
  354.   End If
  355.   If Form2.Left + ((Screen.Width - Form2.Width) / 2) / Xtra5 > (Screen.Width - Form2.Width) / 2 And Form2.Top + ((Screen.Height - Form2.Height) / 2) / Xtra5 > (Screen.Height - Form2.Height) / 2 Then
  356.   Form2.Left = (Screen.Width - Form2.Width) / 2
  357.   Form2.Top = (Screen.Height - Form2.Height) / 2
  358.   GoTo EndE
  359.   Else
  360.   Amount = ((Screen.Width - Form2.Width) / 2) / Xtra5
  361.   Form2.Left = Form2.Left + Amount
  362.   Amount = ((Screen.Height - Form2.Height) / 2) / Xtra5
  363.   Form2.Top = Form2.Top + Amount
  364.   End If
  365. End If
  366. Exit Sub
  367. EndE:
  368. Timer1.Enabled = False
  369. End Sub
  370. Private Sub Timer2_Timer()
  371. If Shutdown = 1 Then
  372. 'Zoom In
  373.   If Start = True Then
  374.   Form2.Width = Screen.Width
  375.   Form2.Height = Screen.Height
  376.   Form2.Left = 0
  377.   Form2.Top = 0
  378.   Start = False
  379.   End If
  380. Amount = 100
  381. Form2.Move (Screen.Width - Form2.Width) / 2, (Screen.Height - Form2.Height) / 2
  382.   If Screen.Width - 1 < Form2.Width And Screen.Height - 1 < Form2.Height Then
  383.   GoTo EndE
  384.   ElseIf Screen.Width - 1 < Form2.Width Then
  385.   Form2.Width = Screen.Width
  386.   Form2.Height = Form2.Height + Amount
  387.   ElseIf Screen.Height - 1 < Form2.Height Then
  388.   Form2.Height = Screen.Height
  389.   Form2.Width = Form2.Width + Amount
  390.   Else
  391.   Form2.Height = Form2.Height + Amount
  392.   Form2.Width = Form2.Width + Amount
  393.   End If
  394. Form2.Move (Screen.Width - Form2.Width) / 2, (Screen.Height - Form2.Height) / 2
  395. ElseIf Shutdown = 2 Then
  396. 'Zoom Out
  397. Amount = 75
  398. Form2.Move (Screen.Width - Form2.Width) / 2, (Screen.Height - Form2.Height) / 2
  399.   If Form2.Width = 375 And Form2.Height = 405 Then
  400.   GoTo EndE
  401.   ElseIf Form2.Width = 375 Then
  402.   Form2.Height = Form2.Height - Amount
  403.   ElseIf Form2.Height = 405 Then
  404.   Form2.Width = Form2.Width - Amount
  405.   Else
  406.   Form2.Height = Form2.Height - Amount
  407.   Form2.Width = Form2.Width - Amount
  408.   End If
  409. Form2.Move (Screen.Width - Form2.Width) / 2, (Screen.Height - Form2.Height) / 2
  410. ElseIf Shutdown = 3 Then
  411. 'Slide Left
  412. Amount = 75
  413.   If (Form2.Left + Form2.Width) - Amount < 0 Then
  414.   GoTo EndE
  415.   Else
  416.   Form2.Left = Form2.Left - Amount
  417.   End If
  418. ElseIf Shutdown = 4 Then
  419. 'Slide Up
  420. Amount = 75
  421.   If (Form2.Top + Form2.Height) - Amount < 0 Then
  422.   GoTo EndE
  423.   Else
  424.   Form2.Top = Form2.Top - Amount
  425.   End If
  426. ElseIf Shutdown = 5 Then
  427. 'Slide Right
  428. Amount = 75
  429.   If Form2.Left + Amount > Screen.Width Then
  430.   GoTo EndE
  431.   Else
  432.   Form2.Left = Form2.Left + Amount
  433.   End If
  434. ElseIf Shutdown = 6 Then
  435. 'Slide Down
  436. Amount = 75
  437.   If Form2.Top + Amount > Screen.Height Then
  438.   GoTo EndE
  439.   Else
  440.   Form2.Top = Form2.Top + Amount
  441.   End If
  442. ElseIf Shutdown = 7 Then
  443. 'Bounce Left
  444.   If Start = True Then
  445.   Ricochet = True
  446.   Start = False
  447.   Amount = 300
  448.   End If
  449.   If Ricochet = False Then
  450.     If Form2.Top < 1 And Form2.Left + Amount > Screen.Width Then
  451.     GoTo EndE
  452.     Else
  453.     Form2.Left = Form2.Left + Amount
  454.     Form2.Top = Form2.Top - (Amount / 8)
  455.     End If
  456.   Else
  457.     If Form2.Left < 0 Then
  458.     Ricochet = False
  459.     Else
  460.     Amount = 150
  461.     Form2.Left = Form2.Left - Amount
  462.     Form2.Top = Form2.Top - (Amount / 3)
  463.     End If
  464.   End If
  465. ElseIf Shutdown = 8 Then
  466. 'Bounce Right
  467.   If Start = True Then
  468.   Ricochet = True
  469.   Start = False
  470.   Amount = 300
  471.   End If
  472.   If Ricochet = False Then
  473.     If Form2.Left < 0 - Form2.Width And Form2.Top + Form2.Height > Screen.Height - 1 Then
  474.     GoTo EndE
  475.     Else
  476.     Form2.Left = Form2.Left - Amount
  477.     Form2.Top = Form2.Top + (Amount / 8)
  478.     End If
  479.   Else
  480.     If Form2.Left + Form2.Width > Screen.Width - 1 Then
  481.     Ricochet = False
  482.     Else
  483.     Amount = 150
  484.     Form2.Left = Form2.Left + Amount
  485.     Form2.Top = Form2.Top + (Amount / 2)
  486.     End If
  487.   End If
  488. ElseIf Shutdown = 9 Then
  489. 'Up/Down
  490. Amount = 400
  491.   If Start = True Then
  492.   CurPos = 1
  493.   Form2.Top = 0
  494.   Start = False
  495.   Ricochet = False
  496.   End If
  497.   If Ricochet = False Then
  498.     If CurPos = 2 And Form2.Top + Amount > (Screen.Height - Form2.Height) / 2 Then
  499.     Form2.Top = (Screen.Height - Form2.Height) / 2
  500.     GoTo EndE
  501.     Else
  502.       If Form2.Top + Form2.Height > Screen.Height Then
  503.       CurPos = CurPos + 1
  504.       Ricochet = True
  505.       Else
  506.       Form2.Top = Form2.Top + Amount
  507.       End If
  508.     End If
  509.   Else
  510.     If Form2.Top < 0 Then
  511.     Ricochet = False
  512.     Else
  513.     Form2.Top = Form2.Top - Amount
  514.     End If
  515.   End If
  516. ElseIf Shutdown = 10 Then
  517. 'Left/Right
  518. Amount = 400
  519.   If Start = True Then
  520.   CurPos = 1
  521.   Form2.Left = 0
  522.   Start = False
  523.   Ricochet = False
  524.   End If
  525.   If Ricochet = False Then
  526.     If CurPos = 2 And Form2.Left + Amount > (Screen.Width - Form2.Width) / 2 Then
  527.     Form2.Left = (Screen.Width - Form2.Width) / 2
  528.     GoTo EndE
  529.     Else
  530.       If Form2.Left + Form2.Width > Screen.Width Then
  531.       CurPos = CurPos + 1
  532.       Ricochet = True
  533.       Else
  534.       Form2.Left = Form2.Left + Amount
  535.       End If
  536.     End If
  537.   Else
  538.     If Form2.Left < 0 Then
  539.     Ricochet = False
  540.     Else
  541.     Form2.Left = Form2.Left - Amount
  542.     End If
  543.   End If
  544. ElseIf Shutdown = 11 Then
  545. 'Left-Up
  546. Xtra5 = 50
  547.   If Form2.Left + Form2.Width < 1 And Form2.Top + Form2.Height < 1 Then
  548.   GoTo EndE
  549.   Else
  550.   Amount = ((Screen.Width - Form2.Width) / 2) / Xtra5
  551.   Form2.Left = Form2.Left - Amount
  552.   Amount = ((Screen.Height - Form2.Height) / 2) / Xtra5
  553.   Form2.Top = Form2.Top - Amount
  554.   End If
  555. ElseIf Shutdown = 12 Then
  556. 'Left-Down
  557. Xtra5 = 50
  558.   If Form2.Left + Form2.Width < 1 And Form2.Top > Screen.Width - 1 Then
  559.   GoTo EndE
  560.   Else
  561.   Amount = ((Screen.Width - Form2.Width) / 2) / Xtra5
  562.   Form2.Left = Form2.Left - Amount
  563.   Amount = ((Screen.Height - Form2.Height) / 2) / Xtra5
  564.   Form2.Top = Form2.Top + Amount
  565.   End If
  566. ElseIf Shutdown = 13 Then
  567. 'Right-Up
  568. Xtra5 = 50
  569.   If Form2.Left > Screen.Width - 1 And Form2.Top + Form2.Height < 1 Then
  570.   GoTo EndE
  571.   Else
  572.   Amount = ((Screen.Width - Form2.Width) / 2) / Xtra5
  573.   Form2.Left = Form2.Left + Amount
  574.   Amount = ((Screen.Height - Form2.Height) / 2) / Xtra5
  575.   Form2.Top = Form2.Top - Amount
  576.   End If
  577. ElseIf Shutdown = 14 Then
  578. 'Right-Down
  579. Xtra5 = 50
  580.   If Form2.Top > Screen.Height - 1 And Form2.Left > Screen.Width - 1 Then
  581.   GoTo EndE
  582.   Else
  583.   Amount = ((Screen.Width - Form2.Width) / 2) / Xtra5
  584.   Form2.Left = Form2.Left + Amount
  585.   Amount = ((Screen.Height - Form2.Height) / 2) / Xtra5
  586.   Form2.Top = Form2.Top + Amount
  587.   End If
  588. End If
  589. Exit Sub
  590. EndE:
  591. Form1.Show
  592. Form1.EndPreview
  593. Form2.Hide
  594. Unload Me
  595. Timer2.Enabled = False
  596. End Sub
  597.