form display delay

Anti-Rich

Well-known member
Joined
Jul 1, 2006
Messages
325
Location
Perth, Australia
Programming Experience
1-3
Hello everyone,

i have a problem with one of the forms of my application in which when the form initally loads, the interface hangs for a short time. i believe this is because of the 118 checkboxes i have on the form (it is a survey form, where people enter the results of a survey).

does anyone know of a way to speed this up? or hold off the form actually displaying until the checkboxes have been loaded? i thought of multithreading it, but i am unsure of how do this with the GUI, and not only that, but the form would still show up first, and populate the checkboxes on screen in realtime (which isnt what i want to happen) and i think that would look a bit dodgy, with a form showing up and then multiple checkboxes just start appearing on the screen.

if someone could give me a couple of pointers, or something to hold off the displaying of the form until all the controls are loaded, that would be great

cheers
adam
 
The amount of controls you are creating is definately the problem here. Installing an image in the NIC will improve performance in the release version. Other than that you can try starting with the forms opactity set to 0 and increase it in a for/Next loop. Don't ask me why this works, it just does (sometimes !!:) )
 
The amount of controls you are creating is definately the problem here. Installing an image in the NIC will improve performance in the release version. Other than that you can try starting with the forms opactity set to 0 and increase it in a for/Next loop. Don't ask me why this works, it just does (sometimes !!:) )

cheers for the reply vis, i tried the opacity method you suggested and it didnt work, as the form still chunks when its opening.

in regards to this part specifically...

The amount of controls you are creating is definately the problem here. Installing an image in the NIC will improve performance in the release version.
i dont know what you mean in regards to an image on the nic (both image and nic... i have never heard of what you are suggesting).

if you could point me in the direction of a tutorial or a site about what you are talking about that would be great! :)

cheers mate

adam
 
Check out the utility called Ngen.exe to install a 'Native Image' of your app in a a special folder called the Native Image Cache. A Native image means no 'Just In Time compilation' which effectively should speed up your app. Another methods here may be to do your survey in sections.. For example

Section 1.

Loads of questions


On completion on section 1 you could show section two, then section three and so on. Therefore preventing the need to create all the checkboxes at once.
 
cheers for the response vis,

i have a question though...

On completion on section 1 you could show section two, then section three and so on. Therefore preventing the need to create all the checkboxes at once.

do you mean just set the visible to false, or (what i suspect) you mean is to create them programmatically?

cheers
adam
 
Last edited:
Setting visible to false should do the trick, but creating them dynamically is also an option. Both should cure your problem, depends on how you want to build your app.....
 
a brick wall..

hey vis

i was trying to implement your solution in my form and i ran into a bit of a brick wall. individual tab pages actually dont have a visible property! so i just set the tab control's visible property to false and then after the db stuff had been done, i then reset the visible property to true. the only thing is, it still lagged a bit. is there a way to reset an individual tab pages' visible property to false?

cheers
adam
 
have you considered panels within a flowlayoutpanel?

The reason for the FLP is so that you don't have to mess about positioning each panel correctly, just change their visibility and the FLP takes care of the rest.
 
Back
Top