Results 1 to 3 of 3

Thread: Transitions (eg wipes, fades)

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    13

    Question

    I'm using VB5 on WinNT and Win98.

    How do i do transitions such as screen wipes or fade ins and fade outs?

    I have managed to make a screen wipe by putting a frame on top of everything else and then expanding the width of the frame to hide everything underneath but this method ignores any mouse presses until after the transition is over.

    Also the reverse - reducing the width of the frame - doesn't work.

    Does anyone have a solution I can use?

  2. #2
    Guest
    You could use timer and have two integers that store starting place and stopping place of movement.

    Code:
    Dim StartX As Integer
    Dim EndX As Integer
    
    Private Sub Form_Load ()
        StartX = 0
        EndX = ScaleWidth + Frame1.Width
    End Sub
    
    Private Sub Timer1_Timer ()
        If EndX > StartX Then
            If Frame1.Left < EndX Then Frame1.Left = Frame1.Left + 45
            If Frame1.Left < StartX Then Frame1.Left = StartX
        Else
            If Frame1.Left > EndX Then Frame1.Left = Frame1.Left - 45
            If Frame1.Left > StartX Then Frame1.Left = StartX
        End If
        Refresh
    End Sub
    Hope this helps,

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    13
    That's cool - I didn't think of using the Timer.

    However, I've modified the code so that the frame expands from 0 width to the full width of the screen. I should have mentioned that I have to avoid the flickering of the text in a label I put in.

    Dim StartX As Integer
    Dim EndX As Integer

    Private Sub Form_Load()
    StartX = 0
    EndX = ScaleWidth + Frame1.Width
    Timer1.Interval = 50
    End Sub

    Private Sub Timer1_Timer()
    If EndX > StartX Then
    If Frame1.Width < EndX Then Frame1.Width = Frame1.Width + 45
    If Frame1.Left < StartX Then Frame1.Left = StartX
    Else
    If Frame1.Left > EndX Then Frame1.Left = Frame1.Left - 45
    If Frame1.Left > StartX Then Frame1.Left = StartX
    End If
    Refresh
    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