Chapter 8

Displaying Dialogs

What You Will Learn in this Chapter

  • Creating a message box using different buttons and icons
  • Creating an Open dialog that enables you to open files
  • Creating a Save dialog that enables you to save files
  • Creating a Font dialog that enables you to apply the selected font to text
  • Creating a Color dialog that enables you to define and select custom colors
  • Creating a Print dialog that prints text from your application
  • Creating a Browse dialog that enables you to browse for folders Code Downloads for this Chapter

The code downloads for this chapter are found at on the Download Code tab. The code is in the 311813 download and individually named according to the names given throughout the chapter.

Visual Basic 2012 provides several built-in dialogs that help you provide a rich user interface in your front-end applications. These dialogs provide the same common user interface that is found in most Windows applications. They also provide many properties and methods that enable you to customize them to suit your needs while still maintaining the standard look of Windows Forms applications.

This chapter explores these dialogs in depth and shows how you can use them in your Visual Basic 2012 applications to help you build more professional-looking applications for your users.

The MessageBox

MessageBox is one of those dialogs that you will use often as a developer. This dialog enables you to display ...

Get Beginning Visual Basic 2012 now with O’Reilly online learning.

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