Windows.Storage.Pickers.FileOpenPicker

October 13, 2025 ยท View on GitHub

-description

Represents a UI element that lets the user choose and open files.

In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow.

-remarks

To get started accessing files and folders file picker, see Quickstart: Accessing files with File Pickers.

Note

To use a file open picker in a WinUI app (or other desktop app), see the FileOpenPicker class documentation for the Windows App SDK.

For information about how to use this API outside of UWP apps, see Call interop APIs from a .NET app.

Version history

Windows versionSDK versionValue added
190318362CreateForUser
190318362User

-examples

The File picker sample demonstrates how to check whether the app is snapped, how to set file picker properties, and how to show a file picker so that the user can pick one file.

[!code-csharpall_openpicker_checksnapped_showsingle]

[!code-jsall_openpicker_checksnapped_showsingle]

[!code-csharpcs_checksnapped]

Note

You should always make sure that your app is not snapped (or that it can be unsnapped) and set file picker properties regardless of whether the user is picking a single file or multiple files.

[!code-csharpall_openpicker_showmulti]

[!code-jsall_openpicker_showmulti]

-see-also

File picker sample, Quickstart: Accessing files with File Pickers, Blobs sample, Display WinRT UI objects that depend on CoreWindow