Originally posted by shethashish_a
thanks,
but how can I create the TextBox control and place it on the form with the Type object I am having?

Here I will not know the type of the control to be created until runtime.

regards,
You have the object and since it is a TextBox (which you can check with GetType()) you can add it to form by setting it's parent to the Form. That's why you enumerate methods and properties with reflection. You could also convert your object to TextBox:


Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();

foreach (Assembly a in assemblies) {
object o = a.CreateInstance("System.Windows.Forms.TextBox");

if (o != null) {

if (o is TextBox) {
TextBox tb = (TextBox) o;
tb.Parent = Form1;
}

}

or rather as a Control (more general)

if (o is Control) {
Control o = (Control) o;
o.Parent = Form1;
}