autoscrollable panel

Discussion in 'Questions (Windows Mobile)' started by Henry, Nov 12, 2007.

  1. Henry

    Henry Member Licensed User

    Hi everyone :)

    I wanted to make "autoscrollable panel" - to move it left-right on button click. Form width is 240, panel width 480, I want to show left or right part of it with a nice animation between. It works slow on ppc (refresh of controls takes too long). Any chance to make this move more smooth?

    Code:
    For i=-10 To -240 Step -20 
        Panel1.Left=i
        Sleep(
    50)
        Panel1.Refresh 
     
    Next
     Panel1.Left=-
    240
     
  2. agraham

    agraham Expert Licensed User

  3. Henry

    Henry Member Licensed User

    It's ok for me - now I'm only testing and start more serious programing in next year - then new version should be ready, beacause I see that Erel is by heart involved in developing new versions. :)
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    I'm not sure that version 6.0 will help here.
    The controls refresh procedure is done by the OS so there is nothing much that can be done in Basic4ppc side.
    Why do you need 'Panel1.Refresh' ?
     
  5. Henry

    Henry Member Licensed User

    Without Refresh there is no effect of move on my ppc (on desktop it works fine) - just switch between left and right (strange - panel is automatically redrawn after animation and not during it)
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    You can set the Visible property of some of the controls to false during the movement to make the scrolling smoother.
     
  7. Henry

    Henry Member Licensed User

    Thanks Erel - I try to hide numupdown boxes :)
     
  8. Cableguy

    Cableguy Expert Licensed User

    I personally would go with two timers, one for each directio, assuming just left or right, or 4 if up and down were required!!!....Redraw inside the timer automaticaly refreshes the screen(?)....Th eonly prob I ever encoutered were when usin more than 1 timer simultaneously, the timer ticks are not very accurate!!!
     
Loading...