JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Open File Dialogs

As you'd expect from its name, the Open File dialog lets the user select a file to open. In fact, it's the same Open File dialog used by Windows itself. You can see this dialog box in Figure 9.3, as displayed in the OpenFileDialog example on the CD-ROM.

Click To expand
Figure 9.3: An Open File dialog box.

Open File dialogs are supported with the OpenFileDialog class. You can let users select multiple files with the Multiselect property. You can use the ShowReadOnly property to determine if a read-only checkbox appears in the dialog box. The ReadOnlyChecked property indicates whether the read-only checkbox is selected. And the Filter property sets the current file name filter string, which determines the choices that appear in the "Files of type" box in the dialog box. The name and path the user selected is stored in the FileName property of the OpenFileDialog object—and there's a neat shortcut here: you can use the OpenFile method to open the selected file directly.

Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor