Selasa, 13 Juli 2010

peripatetic article animation to right and to is left.



before us step into project, beforehand we draw up toolbox, like hereunder:
1. two timer
2. one label
3. four commandbutton

clarification toolbox:
-->timer
  • timer1 ( name=timer_right, enable=true, interval=100)
  • timer2 (name=timer_left, enable=true, interval=100)
-->label
  • label1 (name=lbl_anim, autosize=true, caption= peripatetic article animation to right and to is left, font=MS Sans Serif, style=bold, size=24)
-->commandbutton
  • commandbutton1 ( name=btnright, caption=move right, font=MS Sans Serif, style=bold, size=18)
  • commandbutton2 ( name=btnleft, caption=move left, font=Ms Sans Serif, style=bold, size=18)
  • commandbutton3 (name=btnstop, caption=stop, font=Ms Sans Serif, style=bold, size=18)
  • commandbutton4 ( name=btnexit, caption=exit, font=Ms Sans Serif, style=bold, size=18)
hereinafter design form, like seeing hereunder;



code program:

Private Sub btnexit_Click()
End
End Sub

Private Sub btnleft_Click()
Timer_left.Enabled = True
End Sub

Private Sub btnright_Click()
Timer_right.Enabled = True
End Sub

Private Sub btnstop_Click()
Timer_right.Enabled = False
Timer_left.Enabled = False
End Sub

Private Sub Form_Load()
Timer_right.Enabled = False
Timer_left.Enabled = False
End Sub


Private Sub Timer_left_Timer()
Dim yadi As String
yadi = lbl_anim.Caption
yadi = Mid(yadi, 2, Len(yadi) - 2) & Left(yadi, 2)
lbl_anim.Caption = yadi
End Sub

Private Sub Timer_right_Timer()
Dim maha As String
maha = lbl_anim.Caption
maha = Right(maha, 2) & Mid(maha, 2, Len(maha) - 2)
lbl_anim.Caption = maha
End Sub

as for code project complete, download here.
presentation items can you download here, process string.

Tidak ada komentar:

Posting Komentar