Flylib.com

Books Software

 
 
 

Microsoft Visual Basic 2005 Express Edition Programming for the Absolute Beginner - page 39


SUMMARY

In this chapter, you learned how to put finishing touches on your Visual Basic application's interfaces through the addition of a menu and toolbars . This included learning how to create menus, menu items, and submenus. You also learned how to enhance your menu system through the addition of shortcuts, access keys, and separator bars. On top of all this, you learned how to create context menus and how to associate them with controls. Finally, you learned how to provide single-click access to your Visual Basic application's most commonly used commands through the creation of toolbars.

Now, before you move on to Chapter 5, take a few minutes and enhance the Lottery Assistant game by implementing the following challenges.



CHALLENGES

  1. Add a menu item under the Help menu that provides instructions for using the Lottery Game using the MessageBox.Show method.

  2. Add a toolbar to the Lottery Assistant game and define buttons for each of the menu items found under the File and Options menus .

  3. Going back to the material that you learned in Chapter 3, "Creating an Application interface," create ToolTips for each TextBox and add a status bar to your application.



Chapter 5: Storing and Retrieving Data in Memory

OVERVIEW

When you interact with a computer application, the information that you provide and the actions that you take are processed by the application. In order to be able to work with this information, the application needs to be able to store data as it collects it so that it can later retrieve and modify the data. In this chapter, you will learn how to store and retrieve data in memory using constants, variables , structures, and arrays. I'll also cover a couple of extra items, including how to embed comments inside your program code and how to work with the ProgressBar control. In addition, you will get the chance to work on a new game project, the Story of Mighty Molly game.

Specifically, you will learn how to:

  • Define constants, variables, structures, and arrays

  • Properly specify data types

  • Convert data from one data type to another

  • Specify variable scope



PROJECT PREVIEW: THE STORY OF MIGHTY MOLLY

In this chapter, you will learn how to create a Visual Basic game called the Story of Mighty Molly. In this game, the player helps to tell the story by providing answers to questions that are designed to collect specific data that is then used to complete the story. Figures 5.1 through 5.5 provide a sneak preview of the Story of Mighty Molly and demonstrate the overall execution of the game.

image from book
Figure 5.1: The Story of Mighty Molly game begins by prompting the player to click on each of six buttons that are designed to collect player input and tell the story.

image from book
Figure 5.2: Players' input is collected using the InputBox() function.

image from book
Figure 5.3: Buttons change colors to indicate that the player has already supplied their associated input.

image from book
Figure 5.4: A progress bar Located on the status bar indicates when all required information has been collected.

image from book
Figure 5.5: Data input collected from the player is then plugged into the story line and displayed for the player to enjoy.

By the time you have created and run this game, you'll have learned how to declare variables and how to specify their data type, scope, and lifetime. In addition, you will have learned how to work with conversion functions and String constants.