I would to create a class which makes instances of controls at runtime,
further the user must be able to pick which control to add to the form.
I already have it working for adding , moving and resizing a control at runtime, the only problem is that i have to specify the type of control in code:
- Control cntrl = new Button
for example.
i would like a class that will just accept a Control and apply the general methods i need to that control.
C# complains when i try to say:
- Class DynmaicControl<C> where C:Control
-
{
-
DynamicControl(Several Arguments)
-
{
-
C someVariable = new C(); // this causes a problem
-
}
-
}
thanks