VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Lines run around an object's border with different colors flashing.

by Mike U. (5 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 23rd February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Lines run around an object's border with different colors flashing.

API Declarations


Dim YPos
Dim R
Dim G
Dim B

Rate Lines run around an object's border with different colors flashing.



    ' Create random RGB colors.
    R = 255 * Rnd
    G = 255 * Rnd
    B = 255 * Rnd
    'Thickness of border
    DrawWidth = 5
    'Top
    For XPos = Shape1.Left To Shape1.Left + Shape1.Width Step 0.5  'The step is 
                                                                   'the speed
    PSet (XPos, Shape1.Top), RGB(R, G, B)
    Next XPos
    'Bottom
    For XPos = Shape1.Left To Shape1.Left + Shape1.Width Step 0.5
    PSet (XPos, Shape1.Top + Shape1.Height), RGB(R, G, B)
    Next XPos
    'Right
    For YPos = Shape1.Top To Shape1.Top + Shape1.Height Step 0.5
    PSet (Shape1.Left + Shape1.Width, YPos), RGB(R, G, B)
    Next YPos
    'Left
    For YPos = Shape1.Top To Shape1.Top + Shape1.Height Step 0.5
    PSet (Shape1.Left, YPos), RGB(R, G, B)
    Next YPos
End Sub


Download this snippet    Add to My Saved Code

Lines run around an object's border with different colors flashing. Comments

No comments have been posted about Lines run around an object's border with different colors flashing.. Why not be the first to post a comment about Lines run around an object's border with different colors flashing..

Post your comment

Subject:
Message:
0/1000 characters