timer event in vb 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mygirl22
    New Member
    • Feb 2009
    • 20

    timer event in vb 2005

    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:
        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
    Last edited by Frinavale; Mar 16 '09, 08:57 PM. Reason: Moved to VB.NET from .NET and changed [quote] tags into [code] tags
  • mygirl22
    New Member
    • Feb 2009
    • 20

    #2
    i got it ...but not i want to stop the timer and button when i click the timer start button..how do i do that?

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      the timer must be enabled only after clicking of the start button and should be disabled initially (form_load event)

      Comment

      • mygirl22
        New Member
        • Feb 2009
        • 20

        #4
        got it

        thanks i solved it...

        Comment

        Working...