Search Tools Links Login

It's amazing what you can do with lines!


Visual Basic 6, or VB Classic

This code draws something wierd...but cool! Lines rules! =)

Original Author: ReXz

Inputs

two timers called 'timer1' and 'timer2' and interval : 1, scalemode : pixel, Backcolor : black

API Declarations

Dim Color As Integer, lx2 As Integer, lx1 As Integer

Code

Private Sub Form_Load()
lx2 = Me.ScaleWidth
Color = 0
End Sub
Private Sub Timer1_Timer()
Color = Color + 1
If Color < 255 Then
Me.ForeColor = RGB(Color, 0, 0)
lx1 = lx1 + 3
lx2 = lx2 - 3
Me.Line (lx1, Me.ScaleLeft)-(lx1, Me.ScaleWidth)
Me.Line (lx2, Me.ScaleWidth)-(lx2, Me.ScaleLeft)
Me.Line (0, lx1)-(Me.ScaleWidth, lx1)
Me.Line (Me.ScaleHeight, lx1)-(Me.ScaleTop, lx2)
ElseIf Color > 254 Then
Timer1.Enabled = False
Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Timer()
Color = Color - 1
If Color > 1 Then
Me.ForeColor = RGB(Color, 0, 0)
lx1 = lx1 + 3
lx2 = lx2 - 3
Me.Line (lx1, Me.ScaleLeft)-(lx1, Me.ScaleWidth)
Me.Line (lx2, Me.ScaleWidth)-(lx2, Me.ScaleLeft)
Me.Line (0, lx1)-(Me.ScaleWidth, lx1)
Me.Line (Me.ScaleHeight, lx1)-(Me.ScaleTop, lx2)
ElseIf Color < 1 Then
Timer2.Enabled = False
End If
End Sub

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 103 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.