Gustavo

Gustavo

  • NA
  • 1.8k
  • 385.3k

How Do I: Call a Class with a variable name?

Apr 24 2010 5:48 PM

Hello:

 

I posted this before but never got a solution, so I am asking again. Maybe someone else can complete this issue.

I want to be able to call a class with a variable name. The name of the class will be in a TextBox.

This is the code that I have at the moment:

 

string TheClass = textBoxClass_ID.Text;

object myDynamicClass = new Assembly.CreateInstance(TheClass);

myDynamicClass();

 

 

Can someone tell me what I am doing wrong?


Answers (9)