Runtime Controls

  • Thread starter Thread starter Joseph Byrns
  • Start date Start date
J

Joseph Byrns

I am creating controls at runtime, 42 of them, which I add to a Panel
(panel.controls.add(the control) or control.parent = panel, tried both, made
no difference), this process takes about 7 seconds, which is undesirable.
Does anyone have any idea how I can improve this?
 
No idea how you're adding 42 controls to a smal screen but your best bet is
probably a custom control that aggregates a bunch of them. Alex Yakhnin did
one for multiple buttons in a sip-like control that works well.


-Chris
 
Thanks,

I have a panel with a scroll bar on it, works well but for the time it takes
to generate the controls. (42 is the worst case, I have eleven different
required control groups, with the number of controls varying between 5 and
42). The reason I have the controls generated is that the number/type of
controls is determined by the contents of an SQLCE database, which is
periodically being altered and I want the application to work regardless of
the database schema.

Is there a way of creating a custom control at runtime, and saving that
custom control to file? I would do this only the very first time the
application is run, then when the application is subsequently run I would
access the files to get the controls? Would this approach even be any
quicker?
 
Back
Top