TipGiver's advice is right on the money. When we do this sort of thing, we deal with several attributes of the control after adding it dynamically as you have described. We also dynamically establish events for the control using generic event methods as needed. For example:
Code:
cht.Location = new System.Drawing.Point(x, y);
cht.Name = string.Format("Chart{0}", i.ToString());
cht.Size = new System.Drawing.Size(200, 200);
cht.TabIndex = i;
cht.Visible = true;
cht.Enter += new System.EventHandler(Chart_Enter);
Clearly there are other attributes you can set. The use of "i" assumes that the code either falls inside a for/next loop or other loop where i is incremented on each pass through the loop.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.