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:
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?
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.
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.
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.
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__ .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With