home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap37 / basicss / frmss.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-28  |  1.6 KB  |  55 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      =   4605
  8.    ClientTop       =   2955
  9.    ClientWidth     =   3870
  10.    Height          =   3435
  11.    Icon            =   "frmSS.frx":0000
  12.    Left            =   4545
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   202
  15.    ScaleMode       =   3  'Pixel
  16.    ScaleWidth      =   258
  17.    ShowInTaskbar   =   0   'False
  18.    Top             =   2610
  19.    Width           =   3990
  20.    WindowState     =   2  'Maximized
  21.    Begin VB.Timer Timer1 
  22.       Interval        =   1000
  23.       Left            =   120
  24.       Top             =   180
  25.    End
  26. Attribute VB_Name = "frmScreenSaver"
  27. Attribute VB_Creatable = False
  28. Attribute VB_Exposed = False
  29. Option Explicit
  30. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  31. EndScreenSaver
  32. End Sub
  33. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  34. EndScreenSaver
  35. End Sub
  36. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  37. Static OldX As Integer
  38. Static OldY As Integer
  39. If (OldX > 0 And OldY > 0) And (Abs(X - OldX) > 5 Or Abs(Y - OldY) > 5) Then
  40.     EndScreenSaver
  41. End If
  42. OldX = X
  43. OldY = Y
  44. End Sub
  45. Private Sub Timer1_Timer()
  46. Dim X1, Y1, X2, Y2 As Integer
  47. Randomize
  48. X1 = Rnd * (ScaleWidth - 1) + 1
  49. Y1 = Rnd * (ScaleHeight - 1) + 1
  50. X2 = Rnd * (ScaleWidth - 1) + 1
  51. Y2 = Rnd * (ScaleHeight - 1) + 1
  52. ForeColor = RGB(Rnd * 255 + 1, Rnd * 255 + 1, Rnd * 255 + 1)
  53. Line (X1, Y1)-(X2, Y2), , BF
  54. End Sub
  55.