home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / swanson / algorith.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-06  |  3.4 KB  |  112 lines

  1. VERSION 2.00
  2. Begin Form Algorithms 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00FFFFFF&
  5.    Caption         =   "Algorithms"
  6.    ClientHeight    =   3810
  7.    ClientLeft      =   3210
  8.    ClientTop       =   2520
  9.    ClientWidth     =   6060
  10.    Height          =   4215
  11.    Left            =   3150
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3810
  14.    ScaleWidth      =   6060
  15.    Top             =   2175
  16.    Width           =   6180
  17.    Begin Frame Frame1 
  18.       BackColor       =   &H00FFFFFF&
  19.       Caption         =   "Redraw Speed"
  20.       Height          =   1575
  21.       Left            =   195
  22.       TabIndex        =   0
  23.       Top             =   120
  24.       Width           =   5655
  25.       Begin CheckBox Check1 
  26.          Caption         =   "AutoRedraw"
  27.          Height          =   255
  28.          Left            =   240
  29.          TabIndex        =   6
  30.          Top             =   1200
  31.          Value           =   1  'Checked
  32.          Width           =   2175
  33.       End
  34.       Begin OptionButton optLineStyle 
  35.          Caption         =   "Lines using Vars"
  36.          Height          =   375
  37.          Index           =   1
  38.          Left            =   240
  39.          TabIndex        =   2
  40.          Top             =   720
  41.          Width           =   2895
  42.       End
  43.       Begin OptionButton optLineStyle 
  44.          Caption         =   "Lines using Properties"
  45.          Height          =   255
  46.          Index           =   0
  47.          Left            =   240
  48.          TabIndex        =   1
  49.          Top             =   360
  50.          Width           =   2775
  51.       End
  52.       Begin Label Label1 
  53.          Caption         =   "Label1"
  54.          Height          =   255
  55.          Left            =   240
  56.          TabIndex        =   5
  57.          Top             =   1200
  58.          Width           =   2295
  59.       End
  60.       Begin Label lblAlgorithm 
  61.          Caption         =   "00.00 secs."
  62.          Height          =   255
  63.          Index           =   1
  64.          Left            =   4080
  65.          TabIndex        =   4
  66.          Top             =   840
  67.          Width           =   1335
  68.       End
  69.       Begin Label lblAlgorithm 
  70.          AutoSize        =   -1  'True
  71.          Caption         =   "00.00 secs."
  72.          Height          =   375
  73.          Index           =   0
  74.          Left            =   4080
  75.          TabIndex        =   3
  76.          Top             =   360
  77.          Width           =   1215
  78.          WordWrap        =   -1  'True
  79.       End
  80.    End
  81. Sub Check1_Click ()
  82.     Cls
  83.     Me.AutoRedraw = Not Me.AutoRedraw
  84. End Sub
  85. Sub Form_Load ()
  86.     'Center the form on load.
  87.     Me.Left = (screen.Width - Me.Width) / 2
  88.     Me.Top = (screen.Height - Me.Height) / 2
  89.     label1 = "AutoRedraw = " & Me.AutoRedraw
  90. End Sub
  91. Sub optLineStyle_Click (Index As Integer)
  92.     Cls
  93.     If optLineStyle(0) Then
  94.         Start = Timer
  95.         For Y = 1 To Me.ScaleHeight Step 5
  96.             Line (0, (Me.ScaleHeight - Y))-(Me.ScaleWidth, (Me.ScaleHeight - Y))
  97.         Next Y
  98.         Finish = Timer
  99.         lblAlgorithm(0) = Format$(Finish - Start, "##.##") & " secs."
  100.     Else
  101.         frmWidth = Me.ScaleWidth
  102.         frmHeight = Me.ScaleHeight
  103.         Start = Timer
  104.         For Y = 1 To frmHeight Step 5
  105.             X = frmHeight - Y
  106.             Line (0, X)-(frmWidth, X)
  107.         Next Y
  108.         Finish = Timer
  109.         lblAlgorithm(1) = Format$(Finish - Start, "##.##") & " secs."
  110.     End If
  111. End Sub
  112.