Selecting a file

This exercise describes how to add a FilePicker to a form:

  1. Click and drag a FilePicker from the Toolbox to the Design Sheet:
  2. Resize

    Click and drag the corners of the control to resize the control.

    Reposition

    Click and drag the handle (top-left) to reposition the control.

  1. You can filter the list of files you want to select based on file extension groups. For example, you might choose to suggest two image file formats as the most likely file selection, but also allow the selection of an image file with any file extension. In this case, the filter format is:
  2. Image files (*.bmp, *.jpg)|*.bmp;*.jpg|All files (*.*)|*.*

    Note:

  3. Add a label that prompts the user to select a file:
  1. Save your changes and click Run to run the form:
  2. Click on the ellipsis button to select a file:
  3. The filter you defined is shown as a drop-down menu:
  4. The file window is filtered based upon the file extension group you have selected: