Hi everybody,
i have a new problem.
I have a class called TypeContainer derived from usercontrol which is used as container for my other usercontrols,
i wrote a rootdesigner for TypeContainer class.
i have test project. there is a class derived from TypeContainer. My usercontrols can be draged from toolbox to design view and in the code part these usercontrols can be added as members. but I noticed that in initializecompoent method there is no "AddRange" statement for my usercontrols.
what i expect is the following:
this.Controls.AddRange( new TypeControl[]{typecontrol1,..})
so,when i close the file and reopen it,i can't see my usercontrols on design view, although their definitions are in code part.
Do you have any idea?
(I used ShapeLibrary sample as reference, AddRange method could be added in test class of ShapeLibrary.How?).
thanks for attention.
Here is my test class code:
i have a new problem.
I have a class called TypeContainer derived from usercontrol which is used as container for my other usercontrols,
i wrote a rootdesigner for TypeContainer class.
i have test project. there is a class derived from TypeContainer. My usercontrols can be draged from toolbox to design view and in the code part these usercontrols can be added as members. but I noticed that in initializecompoent method there is no "AddRange" statement for my usercontrols.
what i expect is the following:
this.Controls.AddRange( new TypeControl[]{typecontrol1,..})
so,when i close the file and reopen it,i can't see my usercontrols on design view, although their definitions are in code part.
Do you have any idea?
(I used ShapeLibrary sample as reference, AddRange method could be added in test class of ShapeLibrary.How?).
thanks for attention.
Here is my test class code:
C#:
public class Component1 : TypeContainer {
private TypeLibrary.TypeControl typeControl1;
private TypeLibrary.TypeControl typeControl2;
private System.ComponentModel.Container components = null;
public Component1(System.ComponentModel.IContainer container){
container.Add(this);
InitializeComponent();
}
public Component1()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.typeControl1 = new TypeLibrary.TypeControl();
this.typeControl2 = new TypeLibrary.TypeControl();
}
}
Last edited by a moderator: