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

Thread: timer event animation

  1. #1
    Join Date
    Feb 2009
    Posts
    8

    Post timer event animation

    Hi ,
    I already created a button "enjoy button" that i want to move in a form when the "timer start button" is clicked.
    how do link the timer to the
    "timer start button" and make it move?

    this is what i tried so far..then am blank
    first

    Code:
    Public Class MainForm
    
        Dim DX As Integer
        Dim DY As Integer
        Dim X As Integer
        Dim Y As Integer
        Dim Counter As Double
    
        Dim Y1 As Integer
        Dim Y2 As Integer
        Dim X1 As Integer
        Dim X2 As Integer
    then
    Code:
        Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Me.xTimer.Enabled = False
        xTimer.Interval = 10
    
        DX = 1
        xDXTextBox.Text = DX
    
        DY = 1
        xDYTextBox.Text = DY
    
    
        Counter = 1000
        xCounterTextBox.Text = Counter
    
        X = 216
        Y = 135
    
        Me.xButtonLabel.Text = "Button(" & X & ", " & Y & ")"
    then

    Code:
        Private Sub TimeStartButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles xTimeStartButton.Click
    
        Me.xTimer.Enabled = True

  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,784

    Re: timer event animation

    You would put your move code in the timer_tick event. The code there will execute with each cycle of the timer while the timer is enabled.

  3. #3
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,875

    Re: timer event animation

    and ENABLE the timer in Form_Load
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,770

    Re: timer event animation

    Everything you need to know and do is detailed in this article on animation in VB.net...

    There are many ways to do animation, using a timer is the easiest.. just follow as it is layed out in the article, and you will come right....

    Gremmy....
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  5. #5
    Join Date
    Feb 2009
    Posts
    8

    Re: timer event animation

    Quote Originally Posted by GremlinSA View Post
    Everything you need to know and do is detailed in this article on animation in VB.net...

    There are many ways to do animation, using a timer is the easiest.. just follow as it is layed out in the article, and you will come right....

    Gremmy....
    thanks

  6. #6
    Join Date
    Feb 2009
    Posts
    8

    Resolved Re: timer event animation

    thanks...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center