How to Loading a form fast??

Hi All,

I'm developting a pocket PC application using CF1.0. On one to my forms I have about 30 buttons. When I load this form (using <form>.Show) there is a small delay displaying it and the form loads each button one at a time.

How can I get this form to load quickly and display all button at once

Thank

Coss



Answer this question

How to Loading a form fast??

  • Damien White

         One of the best way to speed up the form load is

         Check the form inializecomponent method. You will see all the controls are defined, initialized. Check those initialize statements. For example You have TAB control with 3 TAB pages. Rearrange all the control definition so that TAB control loads first then TAB pages. Load all the individual controld on top down approach. Load TAB page1 first and all the controls top dowm.

        For each control you will see two methods called for location and Size. Combine these two methods and replace into one method(There is one but I forgot the name of the method -- Find out by yourself). But you will loose designer view of the control. This will reduce much of load time.

    this.txtBranch.Location = new System.Drawing.Point(128, 8);

    this.txtBranch.Size = new System.Drawing.Size(104, 20);

         


  • Pirooz Javan &amp;#40;Old&amp;#41;

    Thanks, I'll try it out and let you know.

    Coss


  • BobH

    well you would expect a bit of delay since it has to draw the amount of objects on the form/screen.

    if you place 1 button on the form, it will of course load faster than 30 buttons

    I'm sure there maybe another way but not sure myself



  • Enzoe

    it's this.Bounds = new Rectangle(...)



  • HuberSepp

    One of the things we've done to speed up our form loading is always keeping slow forms preloaded in memory, active but hidden. Then when it's time for them to appear we just make them visible. This slowed down our initial startup so we made a splash screen that runs on a seperate thread while the forms are loading.



  • How to Loading a form fast??