I have the value of the Form in a variable: TheForm_ID. I need to figure out how to create an object to the Form so I can loop thru it and load the textBox in the Form.
I tried to use the Control, but cant get it to work. Can someone point me in the correct direction? I have been tring to figure this out for almost 2 weeks... Help.
ClassControl ClassControl = new ClassControl(TheForm_ID);
Control TheControlValue = TheForm.GetNextControl(null, true);
ClassControl is my class where I do most of my work.
Jaish MathewsPosted Jun 1, 2010, 4:28 AM
Try reflection to load dynamically like below
Assembly assemb = Assembly.GetExecutingAssembly();
object form = assemb.CreateInstance("WindowsFormsApplication1.Form1");
MethodInfo minfo = form.GetType().GetMethod("SomeMethod");
minfo.Invoke(form,null);
LiyaPosted Jun 1, 2010, 3:54 AM
as there is no answer, perhaps I could suggest you some simpler way:
create this TextBox with
and when you need it perform on the server side:
txt1.Visible = true