Although Visual Basic 2012 is generally a programming language designed for creating business and other industrial applications and not for creating animation, it can be used to create animation. In this lesson, we will show you just that.
In this section, we will show you how to move an object by pressing a command button. You need to make use of the Top and Left properties of an object to create animation. The Top property defines the distance of the object from the top most border of the screen while the Left property defines the distance of the object from leftmost border of the screen. By adding or subtracting the distance of the object we can create the animated effect of moving an object.
Start a new project and name it as Movable Object, or any name you wish. Now insert a PictureBox and in its Image property import a picture from your hard drive or other sources. Next, insert four command buttons, change their captions to Move Up, Move Down, Move Left and Move Right. Name them as MoveUpBtn, MoveDowbBtn, MoveLeftBtn and MoveRightBtn. Now, click on the buttons and key in the following code:
To learn the details, we suggest you grab a copy of Visual Basic 2012 Made Easy.
AUTHOR: DR. LIEW VOON KIONGVisual Basic 2012 Made Easy is written by Dr. Liew, the webmaster of our popular online Visual Basic Tutorial, vbtutor.net. This book is a complete guide to mastering Visual Basic 2012, from beginner to intermediate programmers. This book has been written to complement our free online Visual Basic 2012 tutorial with much more content. It is also an excellent reference text for high school or college-level computer science courses. Reading this book will allow you to:
*Please wait for 10 seconds for PayPal to redirect you to E-book Download Page after ordering and making payment. If you have problem downloading the book, please contact
Mode of Delivery: Download
This site and the products and services offered on this site are not associated, affiliated, endorsed, or sponsored by Microsoft, nor have they been reviewed tested or certified by Microsoft.
If you require assistant and technical support, please email