Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FolderBrowserDialog in WPF app
Message
From
07/03/2014 08:04:31
 
 
To
All
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
FolderBrowserDialog in WPF app
Environment versions
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01595925
Message ID:
01595925
Views:
29
Hi,

I'm using C# in a WPF application and need to display a windows dialog to let the user specify a folder to use.

This code works in displaying the folder, but I get an error when testing the return result of the dialog:
            FolderBrowserDialog fdlg = new FolderBrowserDialog();
            //fdlg.ShowNewFolderButton = false;
            fdlg.Description = "Select Folder to save the Zip file";
            fdlg.RootFolder = System.Environment.SpecialFolder.MyDocuments;
            //fdlg.RootFolder = Environment.SpecialFolder.Desktop;             fdlg.ShowDialog();
            DialogResult result = fdlg.ShowDialog();

            if (result == DialogResult.OK)
The error occurs on the OK in the final line above (everything else is fine) and is:
'System.Nullable<bool>' does not contain a definition for 'OK' and no extension method 'OK' accepting a first argument of type 'System.Nullable<bool>' could be found (are you missing a using directive or an assembly reference?)
any ideas what I'm missing or an alternative technique?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Next
Reply
Map
View

Click here to load this message in the networking platform