Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(ebook) Visual Studio .NET Mastering Visual Basic.pdf
Скачиваний:
120
Добавлен:
17.08.2013
Размер:
15.38 Mб
Скачать

304 Chapter 7 MORE WINDOWS CONTROLS

Listing 7.2: Processing Multiple Selected Files

Private Sub bttnFile_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles bttnFile.Click OpenFileDialog1.Multiselect = True OpenFileDialog1.ShowDialog()

Dim filesEnum As IEnumerator ListBox1.Items.Clear()

filesEnum = OpenFileDialog1.FileNames.GetEnumerator() While filesEnum.MoveNext

ListBox1.Items.Add(filesEnum.Current) End While

End Sub

The Print Dialog Box

The Print dialog box (Figure 7.8) enables users to select a printer, set certain properties of the printout (e.g., number of copies and pages to be printed), and set up a specific printer.

Figure 7.8

The Print common dialog box

After the user selects a printer and clicks OK, the Print dialog box returns the attributes of the desired printout to the calling program through the following properties:

AllowPrintToFile This property is a Boolean value that controls whether the user will be given the option to print to a file. If set to False, the Print To File option on the dialog will be disabled.

AllowSelection This property is a Boolean value that determines whether the user is allowed to print the current selection of the document. If you don’t want to provide the code for printing a segment of the document, set this property to False.

AllowSomePages This property is a Boolean value that determines whether the Pages option on the dialog will be enabled.

Copyright ©2002 SYBEX, Inc., Alameda, CA

www.sybex.com