Results 1 to 3 of 3

Thread: Fade Window BG Color

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329

    Angry

    I need to fade a window's background color from white to black. (it should take afew seconds)

    Thanks for any help i get!
    ______________

  2. #2
    Guest
    Add the following code to a Form with a CommandButton.
    Code:
    Private Sub Command1_Click()
    
        For i = 0 To 255
            'This line is necessary to create a pause so you can see the Form's
            'colour fading. The Interval (50000) should vary from computer to computer.
            'This works fine on my 500Mhz CPU)
            For x = 1 To 50000
            Next x
            
            DoEvents
            Me.BackColor = RGB(i, i, i)
        Next i
        
    End Sub

  3. #3
    Guest
    That makes it fade from black to white.

    Try this instead:

    Code:
    Private Sub Command1_Click()
        For i = 255 To 0 Step -1
            DoEvents
            For x = 1 To 50000
            Next x
            Me.BackColor = RGB(i, i, i)
        Next i
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width