Using Input Boxes to Get Information from the User

Many times in a program, you need to get a single piece of information from the user. You might need the user to enter a name, the name of a file, or a number for various purposes. Although the message box lets your user make choices, it does not allow him to enter any information in response to the message. Therefore, you have to use some other means to get the information. Visual Basic provides a built-in dialog box for exactly this purpose: the input box.

The input box displays a prompt to tell the user what to enter, a text box where the user can enter the requested information, and two command buttons—OK and Cancel—that can be used to either accept or abort the input data. A typical input ...

Get Special Edition Using Microsoft® Visual Basic® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.