question

dsddrre24-3128 avatar image
0 Votes"
dsddrre24-3128 asked TianyuSun-MSFT edited

OpenFileDialog not found in Visual Studio 2019 toolbox

Hello, I created a wpf project in Visual Studio with IronPython. For some reason, I don't a OpenFileDialog in my toolbox, I even go to "Choose ToolBox Item" to see if I have it. Turns out I do have it but it still not appear in my toolbox after I put a check mark on it. Any suggestions will be appreciated.


vs-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @dsddrre24-3128 , I think you found the “OpenFileDialog” control under “.NET Framework Components” tab(Choose Toolbox Items) instead of under “WPF Components” tab(Choose Toolbox Items) right? Please check @Viorel-1 ’s answer, the “OpenFileDialog” control is not available in WPF project, but it is available in other projects.

0 Votes 0 ·

1 Answer

Viorel-1 avatar image
2 Votes"
Viorel-1 answered Viorel-1 edited

This feature is probably available in case of other kinds of projects (Windows Forms, for example). In WPF you can use the dialog programmatically. (Short example in C# and VB: https://docs.microsoft.com/en-us/dotnet/desktop/wpf/app-development/dialog-boxes-overview). You can find some samples for IronPython too, but use Microsoft.Win32.OpenFileDialog instead of System.Windows.Forms.OpenFileDialog.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.