It is possible that I\'m missing something very obvious but now I can not see now. I have the reference to System.Windows.Forms
and I have the next using<
That's because it IS a type, not a namespace. You don't reference the types in the using statements, only the namespaces. This isn't Java.
It seems that System.Windows.Forms.FolderBrowserDialog is not a namespace but rather a class that is part of the namespace System.Windows.Forms.
The *.Forms.FolderBrowserDialog is a class located within that namespace. Here is an example of how it should be used. (example is at the bottom of the page)
Right now you're trying to import FolderBrowserDialog but it's actually an object. To use it you remove:
using System.Windows.Forms.FolderBrowserDialog;
And instead reference is by creating an object like this...
FolderBrowserDialog x = new FolderBrowserDialog();
System.Windows.Forms.FolderBrowserDialog is a class, is'nt a namespace to using it, clear that line.
You cannot do
using System.Windows.Forms.FolderBrowserDialog;
as it is a type and not a namespace. The namespace it belongs to is System.Windows.Forms
. Remove this line and if you want to instantiate a FolderBrowserDialog
and just make sure you have the line
using System.Windows.Forms;
and make a FolderBrowserDialog
like so:
var fbd = new FolderBrowserDialog();
All this is in contrast to Java, where you import types not use namespaces, which is where you may be going wrong - in Java you would do something like:
import System.Windows.Forms.FolderBrowserDialog;
and then be able to use it.
The using
directive imports namespaces, not types.
Once you import System.Windows.Forms
, you can use all of the types inside of it, including FolderBrowserDialog
.