Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Animate Icon

Status
Not open for further replies.

jonis2144

Programmer
Joined
Apr 26, 2002
Messages
7
Location
CA
hey all

Im using the windows system time to calculate the time between command1 click and command2 click

when i click the command1 button I want a simple animation (2 icon files) to play in a picture box.
when I click the command 2 button I need the animation to stop

Ive been tryin to get it to work but i cant any suggestions?
 
here's an example using two picture boxes, two command buttons, and a timer control

put the second picture box right on top of the first

Code:
Option Explicit

Private Sub Command1_Click()
  Timer1.Enabled = True
End Sub

Private Sub Command2_Click()
  Timer1.Enabled = False
End Sub

Private Sub Form_Load()
  Timer1.Interval = 500
  Timer1.Enabled = False
  Picture1.Picture = LoadPicture("C:\Program Files\Microsoft Visual Studio\Common\Graphics\Icons\Misc\FACE02.ICO")
  Picture2.Picture = LoadPicture("C:\Program Files\Microsoft Visual Studio\Common\Graphics\Icons\Misc\FACE04.ICO")
End Sub

Private Sub Timer1_Timer()
  Picture2.Visible = Not Picture2.Visible
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top