Purchase Solution

Visual Basic (Inventory Application with Keyboard Events)

Not what you're looking for?

Ask Custom Question

See the attached file.

21 .1 1 (Inventory Application with Keyboard Events) Enhance the Inventory application that you developed in Tutorial 4 to prevent the user from entering input that is not a number. Use keyboard events to allow the user to press the number keys, the left and right arrows and the Backspace keys. If any other key is pressed, display a MessageBox instructing the user to enter a number (Fig. 21.34).

a) Copying the template to your working directory. Copy the directory C: Exampl esTutori al 21Exerci sesKeyEventInventory to your C: Si mpl yVB2008 directory.

b) Opening the application's template file. Double click KeyEventInventory. sl n in
the KeyEventInventory directory to open the application.

c) Adding the KeyDown event handler for the first TextBox. Use the Class Name and Method Name ComboBoxes to add an empty KeyDown event handler for the Cartonsper shipment: TextBox.

d) Adding a Select Case statement. Add a Sel ect Case statement to the KeyDown
event handler that uses the Keys enumeration to determine whether a number key, aleft or right arrow, Enter or the Backspace key was pressed.

e) Adding the Case Else statement. Add a Case El se statement that executes when a key other than a valid one for this application was pressed. If an invalid key was pressed, clear the TextBox and display a MessageBox that instructs the user to enter a number.

f) Adding the KeyDown event handler for the second TextBox. Repeat Steps c-e, but this time create a KeyDown event handler for the Items per carton: TextBox. This event handler should have the same functionality as the one for the Cartons per shipment: TextBox.

g) Running the application. Select Debug > Start Debugging to run your application.
Try entering letters or pressing the up- and down-arrow keys in the TextBoxes. A
MessageBox should be displayed. Enter valid input and click the Calculate Total
Button. Verify that the correct output is displayed.

h) Closing the application. Close your running application by clicking its close box.

i) Closing the IDE. Close the Visual Basic IDE by clicking its close box.

Purchase this Solution

Solution Summary

The solution discusses the visual basic regarding inventory application with keyboard events.

Purchase this Solution

Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Basic Networking Questions

This quiz consists of some basic networking questions.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

C# variables and classes

This quiz contains questions about C# classes and variables.