Page 1 of 1

PostPosted: Thu Feb 08, 2001 2:00 pm
by Velvis
I have an multi-form app. One form has about 30 controls. I recently went through the code and added beep(7); to all of the controls in this form to make them have sound when pressed. A number of these controls had no code associated with them.

I just started noticing a long delay when displaying this form. I am a little puzzled as to why adding executable code would delay the display of the form. (ie the delay doesnt happen executing the control)

Is this normal?

PostPosted: Sat Feb 10, 2001 12:08 am
by Power
Hi... about the delay in the form... i notice that too.. but after thinking for a while (this is only a guess until this is verified) since in CControl everything is created dynamically. which mean if we're gonna display this form that has 31 controls on it... it will take time since it has to be made first... try this technique... when starting out have all controls initialize then when you need it call CDraw to draw it... since the control is already in memory then it will simply draw it which translate to faster redraw but this will take up more memory space since the controls are made dynamically... try it out <img src=icon_smile.gif border=0 align=middle>

Edited by - power on 02/09/2001 18:11:49