CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Frame1.move

  1. #1
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Frame1.move

    OK, I use this code:

    X = 4920
    Do Until X <= 120
    X = X - 30
    DoEvents
    Frame1.Move X, 0, 4575, 4455
    Loop



    to scroll my Frame1.....but it won't scroll smoothly, it always scrolls faster or slower, and keeps on jumping from fast to slow
    Is there anyway I can generate high performance scrolling?? Smooth with same speed...no jumps

    Thank You


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Frame1.move

    Use a timer. Add a timer control to your form and
    add the _timer event handler to handle the moving of the Frame. This may be a little smoother than your code, because time taken for "doEvents" depends on the no. of events that are presently there, which may not be uniform always.

    private sub timer1_timer()
    if frame1.Left <= 120 then
    timer1.enabled = false
    exit sub
    end if
    Frame1.left = Frame1.left - 30
    ' you dont need to set the size each time!
    end sub
    ... elsewhere, to start the scrolling
    Frame1.Move 4920,0,4575,4455 ' or whatever
    timer1.interval = 100
    timer1.Enabled = true




    RK

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

Featured