Results 1 to 4 of 4

Thread: [RESOLVED] VB6 Form effect

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    230

    Resolved [RESOLVED] VB6 Form effect

    Hi guys,

    Could anybody help me to do something like:

    On the form_load, the form will be on center of the screen then it will move to 45 degre to the top right corner of the screen, when it reach the corner the form will be unload.

    I really need help about this
    Thanks guy

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: VB6 Form effect

    Try something like this (you will need a Timer control on your form):
    Code:
    Option Explicit
    
    Private Sub Form_Load()
        Me.Move (Screen.Width - Me.Width) / 2, _
                (Screen.Height - Me.Height) / 2
        
        Timer1.Interval = 1 '1/1000 of a second
        Timer1.Enabled = True
    End Sub
    
    Private Sub Timer1_Timer()
    Static i As Long
    
        'delay a bit
        i = i + 1
        
        If i > 100 Then
            
            Me.Move Me.Left + 1, Me.Top - 1
            If Me.Left + Me.Width > Screen.Width Or Me.Top <= 0 Then
                Timer1.Enabled = False
                Unload Me
            End If
            
        End If
    
    End Sub
    NOTE: I left you plenty of room for improvements.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    230

    Re: VB6 Form effect

    thanks alot

  4. #4

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