Message and Input Boxes

Sometimes your applications will need to display messages and ask questions of the user. Some messages and questions are best displayed from within a dialog box such as the one in Figure 6.10. Such a dialog box pops up with a message or question when needed but stays out of the way and does not require extra controls on your form at other times.

For example, suppose you want to know if the user has prepared the printer for printing a report. The user has to turn on the printer, make sure it has paper, and see that the online light is on. Your program should not attempt to print until the user has performed these actions, or an error will occur. Therefore, when it is time to print, your application pauses to ask the user ...

Get Absolute Beginner's Guide to Programming, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.