Program for implementing a small animation clip in an application :
Steps:
(The other two controls Animation and CommonDialog will not appear on the screen while running)
Attaching Code to the Object :
Output :
When you press PLAY , a screen will appear ,open any file with AVI format.And you will get the same loaded form with a new running animation file which you have choosen.
To stop animation,you can press STOP button.
(Refer this Video explaining a simple animation)
=========================================================================
Back to Home & VB
Steps:
- Start VB
- Project --> Components (Ctrl T)
- Add a component file comct232.ocx to the project from control tab in the window.(Select "Microsoft windows common controls-2.5.0(SP2))
- Apply-OK
- We will get two new controls in the tool box(up-down control and animation control)
- Now, add the animation control in our form
- Add two command buttons in our form and set their caption property as Play and Stop
- Again , Project --> Components (Ctrl T)
- Add a component file comdlg32.ocx to the project from control tab in the window.(Select "Microsoft common dialog controls-6.0(SP6))
- Apply-OK
- Now, add this new control in our form.
(The other two controls Animation and CommonDialog will not appear on the screen while running)
Attaching Code to the Object :
Private Sub Command1_Click() CommonDialog1.Filter = "*.AVI" CommonDialog1.ShowOpen Animation1.Open CommonDialog1.FileName Animation1.Play End Sub |
Private Sub Command2_Click() Animation1.Stop End Sub |
Output :
When you press PLAY , a screen will appear ,open any file with AVI format.And you will get the same loaded form with a new running animation file which you have choosen.
To stop animation,you can press STOP button.
(Refer this Video explaining a simple animation)
=========================================================================
Back to Home & VB
No comments:
Post a Comment