home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap37 / enhanss / frmss.frm (.txt) < prev    next >
Visual Basic Form  |  1995-09-28  |  2KB  |  59 lines

  1. VERSION 4.00
  2. Begin VB.Form frmScreenSaver 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   0  'None
  6.    ClientHeight    =   3030
  7.    ClientLeft      =   4125
  8.    ClientTop       =   2625
  9.    ClientWidth     =   3870
  10.    ControlBox      =   0   'False
  11.    Height          =   3435
  12.    Icon            =   "frmSS.frx":0000
  13.    Left            =   4065
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    MousePointer    =   99  'Custom
  18.    ScaleHeight     =   202
  19.    ScaleMode       =   3  'Pixel
  20.    ScaleWidth      =   258
  21.    ShowInTaskbar   =   0   'False
  22.    Top             =   2280
  23.    Width           =   3990
  24.    WindowState     =   2  'Maximized
  25.    Begin VB.Timer Timer1 
  26.       Interval        =   1000
  27.       Left            =   120
  28.       Top             =   180
  29.    End
  30. Attribute VB_Name = "frmScreenSaver"
  31. Attribute VB_Creatable = False
  32. Attribute VB_Exposed = False
  33. Option Explicit
  34. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  35. EndScreenSaver
  36. End Sub
  37. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  38. EndScreenSaver
  39. End Sub
  40. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  41. Static OldX As Integer
  42. Static OldY As Integer
  43. If (OldX > 0 And OldY > 0) And (Abs(X - OldX) > 5 Or Abs(Y - OldY) > 5) Then
  44.     EndScreenSaver
  45. End If
  46. OldX = X
  47. OldY = Y
  48. End Sub
  49. Private Sub Timer1_Timer()
  50. Dim X1, Y1, X2, Y2 As Integer
  51. X1 = Rnd * (ScaleWidth - 1) + 1
  52. Y1 = Rnd * (ScaleHeight - 1) + 1
  53. X2 = Rnd * (ScaleWidth - 1) + 1
  54. Y2 = Rnd * (ScaleHeight - 1) + 1
  55. ForeColor = RGB(Rnd * 255 + 1, Rnd * 255 + 1, Rnd * 255 + 1) ' Set foreground color.
  56. Line (X1, Y1)-(X2, Y2), , BF
  57. If giBeepBox = True Then Beep
  58. End Sub
  59.