Which OpenFileDialog control property specifies the choices in the "Files of type" dropdown box?

  1. FileName

  2. FileNames

  3. FileType

  4. Filter

  5. FilterIndex


Correct Option: D
Explanation:

To answer this question, the user needs to have knowledge of the OpenFileDialog control and its properties.

The OpenFileDialog control is a common dialog box provided by the .NET framework that allows users to browse and select files from the file system.

Now, let's go through each option and explain whether it specifies the choices in the "Files of type" dropdown box:

A. FileName: This property represents the name of the file selected in the dialog box. It does not specify the choices in the "Files of type" dropdown box.

B. FileNames: This property represents an array of file names selected in the dialog box. It does not specify the choices in the "Files of type" dropdown box.

C. FileType: This property does not exist in the OpenFileDialog control. Therefore, it does not specify the choices in the "Files of type" dropdown box.

D. Filter: This property specifies the filter string that determines the choices in the "Files of type" dropdown box. It allows you to specify the types of files that can be selected in the dialog box based on their extensions.

E. FilterIndex: This property specifies the index of the default filter to display in the "Files of type" dropdown box. It does not specify the choices in the dropdown box itself.

Therefore, the correct answer is:

D. Filter

Find more quizzes: