View Single Post
  #4 (permalink)  
Old 09-13-2009, 03:56 AM
Ariel_Z's Avatar
Ariel_Z Ariel_Z is offline
Basic4ppc Veteran
 
Join Date: May 2009
Posts: 246
Default

Try this (note that I use form1.text for dubug only):

Code:
Sub Globals
    
'Declare the global variables here.
    jump = -10
End Sub

Sub App_Start
    AddForm(
"Form1""Form1")
    AddPanel(
"Form1""Panel1"0, Form1.Height, Form1.Width, 100)
    AddTimer(
"Timer1")
    panel1.color = cRed
    AddButton(
"Form1""B2"005050)
    form1.text = panel1.top
    timer1.interval = 
10
    AddButton(
"Panel1""B1"90205050)
    Form1.Show
    
End Sub

Sub Timer1_Tick
    panel1.top = panel1.top + jump
    form1.text = panel1.top

    
If panel1.top + panel1.height <= form1.height Then
        panel1.top = form1.height - panel1.height
        timer1.enabled = 
False
    
End If
End Sub

Sub b2_Click
    timer1.enabled = 
True
End Sub
Sub B1_Click

    AppClose
End Sub
Reply With Quote