Thursday, April 23, 2009

Visual Basic Polling System

Survey and polling tools are often used in marketing or politics to assess

rating for certain services or products. Polling tools can take many forms, some just use a simple dichotomous scale of Yes and No, or Likert Scale that consists of three or more choices. You can create Polling tool in Visual Basic easily by using the option buttons. In my program, I give the users five choices, Excellent, Very Good, Good, Satisfactory and Bad. Then the results are presented in frequency and percentage respectively.

To learn how to program the above polling system in VB, please view my sample polling program at

http://www.vbtutor.net/VB_Sample/poll.htm

Sunday, April 12, 2009

VB Snakes and Ladders game

Snakes and Ladders game is a popular board game for young children. This game usually involves two or more players and they take turns to move by rolling a dice. On the way to the finishing point, the players will meet with some hurdles in the form of snakes and some opportunities in the form of ladders. Whenever the player encounters a snake (or more accurately, the snake’s head), he or she will be thrown back to an earlier box (which is at the snake’s tail). On the other hand, whenever the player encounters a ladder, he or she can climb up the ladder to a higher box. The player who reaches the finishing point first wins the game

To design the program in VB, it took me one day to think out the mathematical logics and wrote out the routines on paper (not in front of the computer). Since the board comprises 10 rows and 10 columns, each box thus represents a cell with the coordinate (column, row). Therefore, I figured out that I need to define the coordinate of every cell by declaring two arrays row(10) and col(10) at the beginning of the procedure. To move the chess piece, I employed the method object.move col(i), row(j), where I initiate the values of col(i) and row(j) in a For....Next loop. As the motion is in a zigzag manner, I need to control the motion using reverse order and by imposing some conditions.

To learn more about the program, check out the link below:

Snakes and Ladders Game

Saturday, April 4, 2009

Microsoft Multimedia Control

The Microsoft Multimedia Control is a very useful tool. Basically it is used to create multimedia programs that can play sound, music and video files.

To be able to play multimedia files or multimedia devices, you have to insert Microsoft Multimedia Control into your VB applications that you are going to create. However, Microsoft Multimedia Control is not normally included in the default toolbox, therefore you need to add the MM control by pressing Ctrl+T and select it from the components dialog box that is displayed.

To learn how to create multimedia applications, please refer to the following lessons in Vbtutor.net.

http://www.vbtutor.net/lesson19.html

http://www.vbtutor.net/lesson20.html

http://www.vbtutor.net/lesson21.html

http://www.vbtutor.net/lesson22.html