Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show the "modern" open file dialog?

Tags:

c#

wpf

I'm remaking on Visual Studio (on C# WPF application mode) an application made on AutoPlay media Studio.

When I needed get files from computer, I found on StackOverflow and in other sites a code to do it, using OpenFileDialog(); but this code shows the older dialog:

enter image description here

But, on the Application made in AMS, the "Open File" is the "Modern" Dialog Window.

Is there any way to Show the "modern" Open File dialog on C# WPF?

like image 203
Kennedy Souza Avatar asked Apr 13 '15 01:04

Kennedy Souza


People also ask

What is a file open dialog?

In computing, a file dialog (also called File Selector/Chooser, file requester, or open and save dialog) is a dialog box-type graphical control element that allows users to choose a file from the file system.

How do I open a dialog box in Python?

Use the askopenfilename() function to display an open file dialog that allows users to select one file. Use the askopenfilenames() function to display an open file dialog that allows users to select multiple files.

How do I prompt a user to select a file in Python?

In most cases, we use the filedialog. askopenfilename() function to ask the user to browse and open a file from the system. Based on the selection of the filetype, the script is programmed to perform write or read operation.

How do I request a file path in Python?

Create a Python script file ( file_path.py ) with the following code in the lower directory ( data/src ). Run it with the python (or python3 ) command. You can get the absolute path of the current working directory with os. getcwd() and the path specified with the python3 command with __file__ .


1 Answers

Thanks vesan, I changed Microsoft.Win32.OpenFileDialog to System.Windows.Forms.OpenFileDialog, and now the code shows the "Modern" Open File Dialog!

Now I just have to adjust the code to work completely.

like image 147
Kennedy Souza Avatar answered Sep 30 '22 03:09

Kennedy Souza