Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FolderBrowserDialog in WPF app
Message
De
07/03/2014 08:04:31
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
FolderBrowserDialog in WPF app
Versions des environnements
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01595925
Message ID:
01595925
Vues:
30
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform