Create object from namespace

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

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).

Thank you for any help,
Bill
 
Bill said:
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.
 
Back
Top