Bill <an*******@discussions.microsoft.com> wrote:
What is the syntax in C# to create an object from a
namespace string?
I've got a treeview that opens forms. The treeview
stores the namespace for each form (all in same
assembly).
There's no such thing as an object for a namespace - only for a type.
Did you mean full type name when you wrote namespace? If so, using
Assembly.GetType or Type.GetType will get the appropriate Type for you,
and then you can call Activator.CreateInstance to create an instance of
the type.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too