-
March 15th, 2009, 12:26 AM
#1
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
-
March 15th, 2009, 02:15 AM
#2
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.
-
March 15th, 2009, 09:37 AM
#3
Re: timer event animation
and ENABLE the timer in Form_Load
-
March 15th, 2009, 02:18 PM
#4
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.
-
March 19th, 2009, 06:41 PM
#5
Re: timer event animation
Originally Posted by GremlinSA
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
-
March 19th, 2009, 06:53 PM
#6
Re: timer event animation
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|