Creating controls on the fly is very slow

Hello there.

I've got an application whereby I'm creating a user interface on the fly, creating survey sections with questions, and responses (such as radio buttons, checkboxes, etc) at runtime.  The client is simple, as this survey engine does most of the work. Running this on a laptop/desktop on .net framework 2 has fine performance, running the same code on a PDA running Mobile 5 on Compact Framework 2 has terrible performance.  I believe the creation of controls and positioning/resizing may be the largest issue.  Does anyone have experience in how to properly (and performantly) do this on the Compact Framework  

thanks

OK, turns out the performance bottleneck was more closely related to a collection (using BindingList<T> under the hood).  That coupled with some late-bound reflection code was causing most of the performance issues, so I believe I'm square now. thank you




Answer this question

Creating controls on the fly is very slow

  • Tryin2Bgood

    Do you have issues with "normal" forms If you execute your code without actually creating controls, how long that takes



  • FSchmid

    Approximately how many lines of code do you think is executed per control I have not ran into too many unexpected performance problems when developing PDA. I assume that your mobile device is pretty beefed up
  • Vishal Ghotge

    I have about same problem as u in CF2.0 with VS2005 when i'm developing WM5 application. I have about 10 buttons on a form A with some adjustments on their properties. I just handle the click event for each of them and direct to other form, that's all, but to load these 10 buttons costs me around 4-5 secs. i also understand that this form A is minimized when i open new form but why is the form A taking so long to redraw all button controls when I close the new form


    Regards,

    shahrul

  • Creating controls on the fly is very slow